package com.yanqu.road.server.manger.activity;

import com.alibaba.fastjson.JSONObject;
import com.yanqu.road.entity.activity.*;
import com.yanqu.road.entity.activity.mall.MallActivityInfo;
import com.yanqu.road.entity.config.goods.GoodsInfo;
import com.yanqu.road.entity.config.goods.MallInfo;
import com.yanqu.road.entity.enums.activity.chefDuel.eChefDuelActivityType;
import com.yanqu.road.entity.enums.activity.eActivityChargeType;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.entity.enums.eLogMoneyType;
import com.yanqu.road.entity.enums.eWelfareActivityType;
import com.yanqu.road.entity.enums.rank.eRankInfo;
import com.yanqu.road.entity.log.LogDecoration;
import com.yanqu.road.entity.player.UserDecoration;
import com.yanqu.road.entity.recharge.FindActivityResult;
import com.yanqu.road.entity.servercenter.ChannelInfo;
import com.yanqu.road.entity.web.activity.GetActivityIdByServerIdReqParam;
import com.yanqu.road.entity.web.activity.GetActivityIdByServerIdRespParam;
import com.yanqu.road.logic.bussiness.player.UserDecorationBussiness;
import com.yanqu.road.logic.bussiness.servercenter.ActivityBussiness;
import com.yanqu.road.logic.config.ChannelConfig;
import com.yanqu.road.logic.helper.ActivityHelper;
import com.yanqu.road.pb.rank.RankProto;
import com.yanqu.road.pb.rank.UnionActivityRankProto;
import com.yanqu.road.pb.union.cross.CrossUnionProto;
import com.yanqu.road.server.GameServer;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.tomb.TombMgr;
import com.yanqu.road.server.gameplayer.module.cricket.CricketMgr;
import com.yanqu.road.server.gameplayer.module.player.DecorationModule;
import com.yanqu.road.server.manger.RecoveryReward.RecoveryRewardMgr;
import com.yanqu.road.server.manger.ServerLanguageMgr;
import com.yanqu.road.server.manger.ServerListMgr;
import com.yanqu.road.server.manger.activity.ad.AdActivityMgr;
import com.yanqu.road.server.manger.activity.advertisement.AdvertisementActivityMgr;
import com.yanqu.road.server.manger.activity.apprentice.ApprenticeMgr;
import com.yanqu.road.server.manger.activity.area.AreaWasePkMgr;
import com.yanqu.road.server.manger.activity.assistantcostumemall.AssistantCostumeMallActivityMgr;
import com.yanqu.road.server.manger.activity.biaoju.BiaoJuConfigMgr;
import com.yanqu.road.server.manger.activity.bowart.BowArtMgr;
import com.yanqu.road.server.manger.activity.businessdepart.BusinessDepartMgr;
import com.yanqu.road.server.manger.activity.businessreunion.BusinessReunionActivityMgr;
import com.yanqu.road.server.manger.activity.busyfarming.BusyFarmingMgr;
import com.yanqu.road.server.manger.activity.cat.CatMgr;
import com.yanqu.road.server.manger.activity.carptrip.CarpTripMgr;
import com.yanqu.road.server.manger.activity.celebration.CelebrationMgr;
import com.yanqu.road.server.manger.activity.channelmusicroomrank.ChannelMusicRoomRankActivityMgr;
import com.yanqu.road.server.manger.activity.chat.ActivityChatMgr;
import com.yanqu.road.server.manger.activity.chefduel.ChefDuelPhase1Mgr;
import com.yanqu.road.server.manger.activity.chinesechess.ChineseChessMgr;
import com.yanqu.road.server.manger.activity.climbtower.ClimbTowerMgr;
import com.yanqu.road.server.manger.activity.commonteam.CommonTeamMgr;
import com.yanqu.road.server.manger.activity.commonwish.CommonWishMgr;
import com.yanqu.road.server.manger.activity.crosspasture.CrossPastureMgr;
import com.yanqu.road.server.manger.activity.dafuweng.DaFuWengMgr;
import com.yanqu.road.server.manger.activity.deepfishing.DeepFishingMgr;
import com.yanqu.road.server.manger.activity.diggold.DigGoldMgr;
import com.yanqu.road.server.manger.activity.doublespring.DoubleSpringActivityMgr;
import com.yanqu.road.server.manger.activity.douluodalu.DouLuoDaLuMgr;
import com.yanqu.road.server.manger.activity.dragonboatrace.DragonBoatRaceMgr;
import com.yanqu.road.server.manger.activity.drawPictures.DrawPicturesActivityMgr;
import com.yanqu.road.server.manger.activity.drink.DrinkMgr;
import com.yanqu.road.server.manger.activity.dunhuangshiku.DunHuangShiKuMgr;
import com.yanqu.road.server.manger.activity.eggs.EggsActivityMgr;
import com.yanqu.road.server.manger.activity.entername.EnterNameActivityMgr;
import com.yanqu.road.server.manger.activity.evefeast.EveFeastMgr;
import com.yanqu.road.server.manger.activity.fanxiuspring.FanXiuSpringMgr;
import com.yanqu.road.server.manger.activity.feast.ShanHeFeastMgr;
import com.yanqu.road.server.manger.activity.fellingtrees.FellingTreesMgr;
import com.yanqu.road.server.manger.activity.festivalgift.FestivalGiftMgr;
import com.yanqu.road.server.manger.activity.fivehero.FiveHeroMgr;
import com.yanqu.road.server.manger.activity.flowercard.FlowerCardsMgr;
import com.yanqu.road.server.manger.activity.flowerstudy.FlowerStudyMgr;
import com.yanqu.road.server.manger.activity.fouractivity.FourActivityMgr;
import com.yanqu.road.server.manger.activity.foxcard.FoxCardMgr;
import com.yanqu.road.server.manger.activity.gashapon.GashaponMgr;
import com.yanqu.road.server.manger.activity.ghost.GhostMgr;
import com.yanqu.road.server.manger.activity.goddess.GoddessMgr;
import com.yanqu.road.server.manger.activity.goldautumn.GoldAutumnMgr;
import com.yanqu.road.server.manger.activity.gourdchild.GourdChildMgr;
import com.yanqu.road.server.manger.activity.gourdplant.GourdPlantMgr;
import com.yanqu.road.server.manger.activity.greattrade.GreatTradeMgr;
import com.yanqu.road.server.manger.activity.guagifts.GuaGiftsMgr;
import com.yanqu.road.server.manger.activity.guguoxunbao.GuGuoXunBaoMgr;
import com.yanqu.road.server.manger.activity.hanghai.HangHaiMgr;
import com.yanqu.road.server.manger.activity.harps.HarpsMgr;
import com.yanqu.road.server.manger.activity.hell.HellMgr;
import com.yanqu.road.server.manger.activity.hongxian.HongXianActivityMgr;
import com.yanqu.road.server.manger.activity.horserun.HorseRunMgr;
import com.yanqu.road.server.manger.activity.hsisland.HsIslandActivityMgr;
import com.yanqu.road.server.manger.activity.huashigang.HuaShiGangMgr;
import com.yanqu.road.server.manger.activity.iceservergift.IceServerGiftMgr;
import com.yanqu.road.server.manger.activity.jianchuanghua.JianChuangHuaMgr;
import com.yanqu.road.server.manger.activity.jieshi.JieShiMgr;
import com.yanqu.road.server.manger.activity.jinli.JinLiMgr;
import com.yanqu.road.server.manger.activity.jumppot.HotpotJumpMgr;
import com.yanqu.road.server.manger.activity.langyamemorial.LangYaMemorialMgr;
import com.yanqu.road.server.manger.activity.langyabang.LangYaBangMgr;
import com.yanqu.road.server.manger.activity.lanruosi.LanRuoSiMgr;
import com.yanqu.road.server.manger.activity.lottery.ActivityLotteryMgr;
import com.yanqu.road.server.manger.activity.luckydraw.LuckyDrawMgr;
import com.yanqu.road.server.manger.activity.liondance.LionDanceMgr;
import com.yanqu.road.server.manger.activity.luckyshop.LuckyShopMgr;
import com.yanqu.road.server.manger.activity.mall.ActivityRmbMallTouchMgr;
import com.yanqu.road.server.manger.activity.mammonhall.MammonHallMgr;
import com.yanqu.road.server.manger.activity.memorypieces.MemoryPiecesMgr;
import com.yanqu.road.server.manger.activity.monjinlottery.SelectLotteryMgr;
import com.yanqu.road.server.manger.activity.musicroomrank.MusicRoomRankActivityMgr;
import com.yanqu.road.server.manger.activity.newserverwelfare.NewServerWelfareMgr;
import com.yanqu.road.server.manger.activity.newyear2023.FireWorkMgr;
import com.yanqu.road.server.manger.activity.jiuzhou.JiuZhouMgr;
import com.yanqu.road.server.manger.activity.oldplayerreturn.OldPlayerReturnMgr;
import com.yanqu.road.server.manger.activity.operamask.OperaMaskMgr;
import com.yanqu.road.server.manger.activity.orewar.OreWarActivityMgr;
import com.yanqu.road.server.manger.activity.patronsfund.PatronsFundMgr;
import com.yanqu.road.server.manger.activity.pasture.PastureMgr;
import com.yanqu.road.server.manger.activity.pawnshop.PawnshopMgr;
import com.yanqu.road.server.manger.activity.peakseacraft.PeakSeacraftMgr;
import com.yanqu.road.server.manger.activity.peakstronghold.PeakStrongholdActivityMgr;
import com.yanqu.road.server.manger.activity.pixiu.PiXiuActivityMgr;
import com.yanqu.road.server.manger.activity.platform.PlatformActivityMgr;
import com.yanqu.road.server.manger.activity.platform.PlatformMailAntiActivityMgr;
import com.yanqu.road.server.manger.activity.ppl.PplMgr;
import com.yanqu.road.server.manger.activity.qixi.QixiMgr;
import com.yanqu.road.server.manger.activity.qqprivilege.QQPrivilegeMgr;
import com.yanqu.road.server.manger.activity.rankunionwar.RankUnionWarMgr;
import com.yanqu.road.server.manger.activity.newyearbag.NewYearBagMgr;
import com.yanqu.road.server.manger.activity.recallplayer.RecallPlayerMgr;
import com.yanqu.road.server.manger.activity.ruishou.RuiShouMgr;
import com.yanqu.road.server.manger.activity.seacraft.SeacraftPirateRiotMgr;
import com.yanqu.road.server.manger.activity.seacraft.SeacraftSouthSeaMgr;
import com.yanqu.road.server.manger.activity.shanshui.XingYouShanShuiMgr;
import com.yanqu.road.server.manger.activity.share.ShareActivityMgr;
import com.yanqu.road.server.manger.activity.shrek.DouLuoShrekMgr;
import com.yanqu.road.server.manger.activity.shuihu.ShuiHuMgr;
import com.yanqu.road.server.manger.activity.shuihuyezicard.ShuiHuYeZiCardMgr;
import com.yanqu.road.server.manger.activity.shushan.ShuShanMgr;
import com.yanqu.road.server.manger.activity.signindraw.SignInDrawActivityMgr;
import com.yanqu.road.server.manger.activity.silkroad.SilkRoadMgr;
import com.yanqu.road.server.manger.activity.sonhai.SonHaiActivityMgr;
import com.yanqu.road.server.manger.activity.springdraw.SpringDrawMgr;
import com.yanqu.road.server.manger.activity.springunionbanquet.SpringUnionBanquetMgr;
import com.yanqu.road.server.manger.activity.starlight.StarLightMgr;
import com.yanqu.road.server.manger.activity.stelesoul.SteleSoulMgr;
import com.yanqu.road.server.manger.activity.snowgarden.ActivityMallDayBuyMgr;
import com.yanqu.road.server.manger.activity.snowgarden.SnowGardenMgr;
import com.yanqu.road.server.manger.activity.suitang.SuiTangMgr;
import com.yanqu.road.server.manger.activity.summergames.SummerGamesActivityMgr;
import com.yanqu.road.server.manger.activity.summerquiz.SummerQuizActivityMgr;
import com.yanqu.road.server.manger.activity.tonbing.TonBingMgr;
import com.yanqu.road.server.manger.activity.tonbingchannel.ChannelTonBingMgr;
import com.yanqu.road.server.manger.activity.tongbing.ChuHanMgr;
import com.yanqu.road.server.manger.activity.tongbing.TongBingMgr;
import com.yanqu.road.server.manger.activity.toyhouse.ToyHouseMgr;
import com.yanqu.road.server.manger.activity.turtle.TurtleMgr;
import com.yanqu.road.server.manger.activity.twins.TwinsMgr;
import com.yanqu.road.server.manger.activity.unionchest.UnionChestMgr;
import com.yanqu.road.server.manger.activity.unionhuaben.UnionHuaBenActivityMgr;
import com.yanqu.road.server.manger.activity.wanyao.WanYaoMgr;
import com.yanqu.road.server.manger.activity.wealthscroll.WealthScrollActivityMgr;
import com.yanqu.road.server.manger.activity.witchdraw.WitchDrawMgr;
import com.yanqu.road.server.manger.activity.xiuxian.XiuXianMgr;
import com.yanqu.road.server.manger.activity.yqhotel.YqHotelMgr;
import com.yanqu.road.server.manger.activity.yuanbaolottery.YuanBaoLotteryMgr;
import com.yanqu.road.server.manger.activity.zhenhuan.ZhenHuanConfigMgr;
import com.yanqu.road.server.manger.activity.zhounianturntable.ZhouNianTurntableMgr;
import com.yanqu.road.server.manger.config.GoodsMgr;
import com.yanqu.road.server.manger.cross3.ChannelActivityMgr;
import com.yanqu.road.server.manger.cross3.ChannelRankActivityMgr;
import com.yanqu.road.server.manger.activity.worldcup.WorldCupMgr;
import com.yanqu.road.server.manger.log.AutoLogMgr;
import com.yanqu.road.server.manger.mammon.MammonMgr;
import com.yanqu.road.server.manger.season.SeasonRewardMgr;
import com.yanqu.road.server.manger.activity.washe.WasheMgr;
import com.yanqu.road.server.manger.activity.springdinner.SpringDinnerMgr;
import com.yanqu.road.server.manger.activity.strongholdwar.StrongholdActivityMgr;
import com.yanqu.road.server.manger.activity.suoyao.SuoYaoMgr;
import com.yanqu.road.server.manger.activity.tanghulu.TangHuLuMgr;
import com.yanqu.road.server.manger.activity.taobao.TaoBaoMgr;
import com.yanqu.road.server.manger.activity.throwingPot.ThrowingPotMgr;
import com.yanqu.road.server.manger.activity.treasure.TreasureActivityMgr;
import com.yanqu.road.server.manger.activity.unionwar.UnionWarActivityMgr;
import com.yanqu.road.server.manger.activity.winterLove.WinterLoveMgr;
import com.yanqu.road.server.manger.activity.wishpool.WishPoolMgr;
import com.yanqu.road.server.manger.activity.xiaowuRecall.XiaowuRecallMgr;
import com.yanqu.road.server.manger.activity.xiayue.XiaYueMgr;
import com.yanqu.road.server.manger.activity.yearMaster.YearMasterMgr;
import com.yanqu.road.server.manger.activity.yingxin.YingXinMgr;
import com.yanqu.road.server.manger.activity.zhanling.ZhanLingActivityMgr;
import com.yanqu.road.server.manger.palace.PalaceActivityMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.manger.specialcookboy.SpecialCookBoyMgr;
import com.yanqu.road.server.manger.specialcookboy.SpecialCookBoySignMgr;
import com.yanqu.road.server.manger.specialtombrob.ActivityDaySignMgr;
import com.yanqu.road.server.manger.specialtombrob.SpecialTombRobMgr;
import com.yanqu.road.server.manger.specialtombrob.SpecialTombRobSignMgr;
import com.yanqu.road.server.manger.union.GameUnionActivityGroupMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.server.webservice.GamePublicFunction;
import com.yanqu.road.utils.ConfigHelper;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.utils.date.DateHelper;
import com.yanqu.road.utils.http.HttpHelper;
import com.yanqu.road.utils.property.Property;
import com.yanqu.road.utils.property.PropertyHelper;
import com.yanqu.road.utils.string.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.yanqu.road.server.manger.activity.daomu.DaoMuActivityMgr;

import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

public class ActivityMgr extends TempMgr {

    private static Logger logger = LogManager.getLogger(ActivityMgr.class.getName());

    private static List<ActivityInfo> allActivityInfos = new ArrayList<>();
    private static Map<Integer, Map<Integer, MallInfo>> allActivityMallInfoMap;  //活动商城

    private static Map<Integer, ActivityInfo> allTempActivityInfoMap = new HashMap<>();

    private static Map<Integer, Map<String, ActivityConfig>> allActivityConfigMap = new ConcurrentHashMap<>();

    //key:道具id
    private static Map<Integer, Set<Integer>> allActivityFundActivityIdsMap = new ConcurrentHashMap<>();

    private static Map<Integer, IActivityMallLimitHandler> extendLimitHandlerMap = new ConcurrentHashMap<>();

    public static int getMallExchangeScoreItemId(int activityId) {
        Map<String, ActivityConfig> configMap = allActivityConfigMap.get(activityId);
        if (configMap == null) {
            return 0;
        }
        ActivityConfig config = configMap.get("EXCHANGE_SCORE_ITEM_ID");
        if (config == null) {
            return 0;
        }
        try {
            return config.getIntValue();
        } catch (Exception e) {
            logger.error("activityId : {} EXCHANGE_SCORE_ITEM_ID config: {} error.", activityId, config.getValue(), e);
        }
        return 0;
    }

    /**
     * 找活动内有配通用活动基金进度道具的道具id
     *
     * @param activityId
     * @return
     */
    public static int getCommonActivityFundProgressItemId(int activityId) {
        Map<String, ActivityConfig> configMap = allActivityConfigMap.get(activityId);
        if (configMap == null) {
            return 0;
        }
        ActivityConfig config = configMap.get("FUND_SCORE_ITEM_ID");
        if (config == null) {
            return 0;
        }
        try {
            return config.getIntValue();
        } catch (Exception e) {
            logger.error("activityId : {} FUND_SCORE_ITEM_ID config: {} error.", activityId, config.getValue(), e);
        }
        return 0;
    }

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    @Override
    public boolean reloadConfig() throws Exception {
        return true;
    }

    @Override
    public boolean stop() {
        return false;
    }

    @Override
    public boolean save() {
        return true;
    }

    @Override
    public boolean reloadData() {
        //重新加载语言
//        ServerLanguageMgr.reloadLanguage();
        //重新载入通用道具
//        CommonMgr.reloadCommonData();
        reloadAllActivityInfoInMemory();
        //载入活动信息
        reloadActivityData();
        return true;
    }

    //定时刷新每日活动加入语言表和通用道具的加载
    public static void taskReload() throws Exception{
        //载入活动信息
        reloadActivityData();
    }

    public static void reloadAllActivityInfoInMemory() {
        logger.info("reload all activity start");
        //重新加载语言
//        ServerLanguageMgr.reloadLanguage();
        //重新载入通用道具
//        CommonMgr.reloadCommonData();
        //刷新服务器状态
//        try {
//            ServerListMgr.reloadServerList();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        // 修改成通过http获取活动idList 再去获取活动信息表
        boolean getActivityByUrl = false;
        Map<Integer, ActivityInfo> allActivityInfoMap = null;
        int channelId = ServerListMgr.getChannelId(GameServer.getInstance().getServerId());
        ChannelInfo channelInfo = ServerListMgr.getChannelInfo(channelId);
        if(channelInfo != null && !StringUtils.isNullOrEmpty(channelInfo.getGetActivityUrl())){
            GetActivityIdByServerIdReqParam getActivityIdByServerIdReqParam  = new GetActivityIdByServerIdReqParam();
            getActivityIdByServerIdReqParam.setType(1);
            getActivityIdByServerIdReqParam.setServerId(Integer.parseInt(ConfigHelper.getValue("serverId")));
            getActivityIdByServerIdReqParam.setServerTime(System.currentTimeMillis()/1000);

            Map<String, String> resultMap = HttpHelper.httpPostJson(channelInfo.getGetActivityUrl(), JSONObject.toJSONString(getActivityIdByServerIdReqParam), "UTF-8", new HashMap<>(),
                    ChannelConfig.CN_FORBIDDEN_WORD_CHECK_SOCKET_TIME_OUT,
                    ChannelConfig.CN_FORBIDDEN_WORD_CHECK_CONNECT_TIME_OUT,
                    ChannelConfig.CN_FORBIDDEN_WORD_CHECK_CONNECT_REQUEST_TIME_OUT);    //1秒超时时间
            if (resultMap != null && "200".equals(resultMap.get("code"))) {
                String resultStr = resultMap.get("body");
                GetActivityIdByServerIdRespParam getActivityIdByServerIdRespParam = JSONObject.parseObject(resultStr, GetActivityIdByServerIdRespParam.class);
                if (getActivityIdByServerIdRespParam.getActivityIdList().size() == 0) {
                    logger.info("not found activity");
                } else {
                    logger.info("find activity {}", JSONObject.toJSONString(getActivityIdByServerIdRespParam));
                    long serverId = GameServer.getInstance().getServerId();
                    allActivityInfoMap = ActivityBussiness.getActivityInfoMap(getActivityIdByServerIdRespParam.getActivityIdList(), serverId);
                    getActivityByUrl = true;
                }
            }
        }

        if (!getActivityByUrl) {
            allActivityInfoMap = ActivityBussiness.getActivityInfoMap(GameServer.getInstance().getServerId());
            logger.info("load db find activity {}", allActivityInfoMap.keySet());
        }

        allTempActivityInfoMap = allActivityInfoMap;
        logger.info("reload all activity end");
    }

    public static void reloadActivityData(){
        logger.info("reload activity start");
        //因为有预加载，先搞一下吧，不然活动加载出来，黄花菜都凉了
        sendUnionCrossExpRankOpen();

        //从数据库读出未完成活动信息
        Map<Integer, ActivityInfo> allActivityInfoMap = allTempActivityInfoMap;
        Map<Integer, ActivityInfo> normalActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> mallActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> commonActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> tradeWarActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> oreWarActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> huaShiGangActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> unionWarActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> StrongholdActivityInfoMap = new ConcurrentHashMap<>();
        Map<Integer, ActivityInfo> relationActivityInfoMap = new ConcurrentHashMap<>();
        List<Integer> mallActivityIdList = new ArrayList<>();
        List<Integer> allActivityIdList = new ArrayList<>();
        for(ActivityInfo activityInfo : allActivityInfoMap.values()){
            if(isNormalRankActivity(activityInfo)){//个人冲榜、商会冲榜
                if(isUnFinishActivity(activityInfo)) {//未结束的活动
                    normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                } else {
                    if(!NormalActivityMgr.isActivityAutoSendReward(activityInfo.getActivityId())){//未发奖的
                        normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                    }
                }
            } else if(isNormalActivity(activityInfo) && isUnFinishActivity(activityInfo)){//普通活动
                normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                if(activityInfo.getType() == eActivityType.RMBMallActivity.getValue()
                    || activityInfo.getType() == eActivityType.SystemOpenRMBMallActivity.getValue()
                    || activityInfo.getType() == eActivityType.CrossRankActivity.getValue()
                    || activityInfo.getType() == eActivityType.CrossUnionActivity.getValue()
                    || activityInfo.getType() == eActivityType.MysteriousMerchantActivity.getValue()
                    || activityInfo.getType() == eActivityType.PageantActivity.getValue()
                    || (activityInfo.getType() == eActivityType.RechargeActivity.getValue() && activityInfo.getChildType() == eActivityChargeType.CanReissueDaysCharge.getChildType())
                    || (activityInfo.getType() == eActivityType.RechargeActivity.getValue() && activityInfo.getChildType() == eActivityChargeType.GoldTokenCharge.getChildType())
                    || (activityInfo.getType() == eActivityType.RechargeActivity.getValue() && activityInfo.getChildType() == eActivityChargeType.TenDayDiscountRecharge.getChildType())
                ){//现金礼包、跨服冲榜、跨服商会争霸有商品信息
                    mallActivityIdList.add(activityInfo.getActivityId());
                }
            } else if (activityInfo.getType() == eActivityType.RechargeActivity.getValue() && (activityInfo.getChildType() == eActivityChargeType.TenDayDiscountRecharge.getChildType() || activityInfo.getChildType() == eActivityChargeType.TimeLimitCharge.getChildType())){    //过期的十日特惠拉出来发奖
                if (!NormalActivityMgr.isActivityAutoSendReward(activityInfo.getActivityId())) {//未发奖的
                    normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                }
            } else if(activityInfo.getType() == eActivityType.MallActivity.getValue() && isUnFinishActivity(activityInfo)){
                mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
            } else if((activityInfo.getType() == eActivityType.CommonActivity.getValue() || activityInfo.getType() == eActivityType.CrossCommonActivity.getValue())
                    && isUnFinishActivity(activityInfo)){
                commonActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
            } else if (isNeedAutoRewardReChageActivity(activityInfo)) {
                long nowTime = System.currentTimeMillis() / 1000;
                if(activityInfo.getEndShowTime() > (nowTime - DateHelper.DAY_SECONDS * 30)){//过期一个月的就不要了
                    normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                }
            } else if(activityInfo.getType() == eActivityType.CrossTradeWarActivity.getValue() && isUnFinishActivity(activityInfo)){
                tradeWarActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
            } else if (activityInfo.getType() == eActivityType.OreWarActivity.getValue() && isUnFinishActivity(activityInfo)) {//盐场活动
                oreWarActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
            } else if (activityInfo.getType() == eActivityType.CrossHuaShiGangActivity.getValue() && isUnFinishActivity(activityInfo)) {
                normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                huaShiGangActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
            } else if (activityInfo.getType() == eActivityType.CrossDunHuangShiKuActivity.getValue() && isUnFinishActivity(activityInfo)) { // 敦煌石窟
                normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
            } else if (activityInfo.getType() == eActivityType.StrongholdWarActivity.getValue() && isUnFinishActivity(activityInfo)) {
                StrongholdActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
            } else if (activityInfo.getType() == eActivityType.CrossUnionWarActivity.getValue() && isUnFinishActivity(activityInfo)) {//跨服商会战
                unionWarActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
                mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
            } else if(activityInfo.getType() == eActivityType.CookingBoyActivity.getValue()) {
                relationActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
                mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
            } else if(activityInfo.getType() == eActivityType.ChefDuel.getValue() && activityInfo.getChildType() != eChefDuelActivityType.Phase1.getChildType()) {//厨神争霸二三阶段走这里
                relationActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                mallActivityIdList.add(activityInfo.getActivityId());
                mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
            } else if(activityInfo.getType() == eActivityType.ChefDuel.getValue() && activityInfo.getChildType() == eChefDuelActivityType.Phase1.getChildType()) {//厨神争霸一阶段走这里
                if(isUnFinishActivity(activityInfo)) {//未结束的活动
                    normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                    mallActivityIdList.add(activityInfo.getActivityId());
                    mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                } else {
                    if (!NormalActivityMgr.isActivityAutoSendReward(activityInfo.getActivityId())) {//未发奖的
                        normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                    }
                }
            } else if (activityInfo.getType() == eActivityType.CrossHolidayActivity.getValue()
                    || activityInfo.getType() == eActivityType.TreasureActivity.getValue()
                    || activityInfo.getType() == eActivityType.DrawPicturesActivity.getValue()
                    || activityInfo.getType() == eActivityType.ShuiHuActivity.getValue()
                    || activityInfo.getType() == eActivityType.TrystActivity.getValue()                         //苗寨幽会
                    || activityInfo.getType() == eActivityType.BusyFarmingActivity.getValue()
                    || activityInfo.getType() == eActivityType.XiaYueActivity.getValue()
                    || activityInfo.getType() == eActivityType.LanRuoSiActivity.getValue()
                    || activityInfo.getType() == eActivityType.GourdChildActivity.getValue()
                    || activityInfo.getType() == eActivityType.NewRechargeActivity.getValue()
                    || activityInfo.getType() == eActivityType.XiaowuRecallActivity.getValue()
                    || activityInfo.getType() == eActivityType.DouLuoDaLuActivity.getValue()
                    || activityInfo.getType() == eActivityType.ClimbTower.getValue()
                    || activityInfo.getType() == eActivityType.GreatTradeActivity.getValue()
                    || activityInfo.getType() == eActivityType.Cat.getValue()
                    || activityInfo.getType() == eActivityType.OldPlayerReturn.getValue()
                    || activityInfo.getType() == eActivityType.XiaoyuCostumeActivity.getValue()                 //小玉服装活动
                    || activityInfo.getType() == eActivityType.CarpTripActivity.getValue()
                    || activityInfo.getType() == eActivityType.LionDance.getValue()
                    || activityInfo.getType() == eActivityType.FanXiuSpringActivity.getValue()
                    || activityInfo.getType() == eActivityType.CommonWishDraw.getValue()
                    || activityInfo.getType() == eActivityType.FlowerCards.getValue()
                    || activityInfo.getType() == eActivityType.RecallPlayerActivity.getValue()
                    || activityInfo.getType() == eActivityType.GoddessActivity.getValue()
                    || activityInfo.getType() == eActivityType.CrossPasture.getValue()
                    || activityInfo.getType() == eActivityType.SignInDraw.getValue()
                    || activityInfo.getType() == eActivityType.LangYaMemorial.getValue()
                    || activityInfo.getType() == eActivityType.GoldAutumn.getValue()
                    || activityInfo.getType() == eActivityType.Advertisement.getValue()
                    || activityInfo.getType() == eActivityType.MeiTuanDeskTop.getValue()
                    || activityInfo.getType() == eActivityType.AddMeiTuanDesktop.getValue()
                    || activityInfo.getType() == eActivityType.FlowerStudy.getValue()
                    || activityInfo.getType() == eActivityType.WanYao.getValue()
                    || activityInfo.getType() == eActivityType.QiXiActivity.getValue()
                    || activityInfo.getType() == eActivityType.GuaGiftsActivity.getValue()
                    || activityInfo.getType() == eActivityType.DigGold.getValue()
                    || activityInfo.getType() == eActivityType.SpecialTombRobSevenSign.getValue()
                    || activityInfo.getType() == eActivityType.DaySign.getValue()
                    || activityInfo.getType() == eActivityType.DaoMu.getValue()
                    || activityInfo.getType() == eActivityType.DaoMuSpecial.getValue()
                    || activityInfo.getType() == eActivityType.WitchDraw.getValue()
                    || activityInfo.getType() == eActivityType.AreaWashePkActivity.getValue()
                    || activityInfo.getType() == eActivityType.JiuZhou.getValue()
                    || activityInfo.getType() == eActivityType.LuckyShop.getValue()
                    || activityInfo.getType() == eActivityType.RuiShou.getValue()
                    || activityInfo.getType() == eActivityType.DoubleSpring.getValue()
                    || activityInfo.getType() == eActivityType.PiXiu.getValue()
                    || activityInfo.getType() == eActivityType.SpringUnionBanquet.getValue()
                    || activityInfo.getType() == eActivityType.SpringDraw.getValue()
                    || activityInfo.getType() == eActivityType.BusinessDepart.getValue()
                    || activityInfo.getType() == eActivityType.SonHai.getValue()
                    || activityInfo.getType() == eActivityType.HsIsland.getValue()
                    || activityInfo.getType() == eActivityType.Turtle.getValue()
                    || activityInfo.getType() == eActivityType.Gashapon.getValue()
                    || activityInfo.getType() == eActivityType.StarLight.getValue()
                    || activityInfo.getType() == eActivityType.IceServerGift.getValue()
                    || activityInfo.getType() == eActivityType.Apprentice.getValue()
                    || activityInfo.getType() == eActivityType.XingYouShanShui.getValue()
            ) {
                if(isUnFinishActivity(activityInfo)) {//未结束的活动
                    normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                    mallActivityIdList.add(activityInfo.getActivityId());
                    mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                } else {
                    if (!NormalActivityMgr.isActivityAutoSendReward(activityInfo.getActivityId())) {//未发奖的
                        normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                        if (activityInfo.getType() == eActivityType.StarLight.getValue() || activityInfo.getType() == eActivityType.IceServerGift.getValue()) {
                            mallActivityIdList.add(activityInfo.getActivityId());
                        }
                    }
                }
            } else if (activityInfo.getType() == eActivityType.SuoYaoActivity.getValue()
                    || activityInfo.getType() == eActivityType.GuGuoXunBaoActivity.getValue()
                    || activityInfo.getType() == eActivityType.HellActivity.getValue()
                    || activityInfo.getType() == eActivityType.DouLuoShrekActivity.getValue()
                    || activityInfo.getType() == eActivityType.SpringDinner.getValue()
                    || activityInfo.getType() == eActivityType.ChineseChess.getValue()
                    || activityInfo.getType() == eActivityType.RankUnionWar.getValue()
                    || activityInfo.getType() == eActivityType.Twins.getValue()
                    || activityInfo.getType() == eActivityType.CricketMallActivity.getValue()
                    || activityInfo.getType() == eActivityType.FireWork2023.getValue()
                    || activityInfo.getType() == eActivityType.FiveHero.getValue()
                    || activityInfo.getType() == eActivityType.ThrowingPotActivity.getValue()               //投壶活动
                    || activityInfo.getType() == eActivityType.YearMasterActivity.getValue()                //瑞兽降福
                    || activityInfo.getType() == eActivityType.PplActivity.getValue()                       //泡泡龙活动
                    || activityInfo.getType() == eActivityType.JianChuangHuaActivity.getValue()
                    || activityInfo.getType() == eActivityType.DaFuWeng.getValue()                          // 大富翁活动
                    || activityInfo.getType() == eActivityType.TangHuluActivity.getValue()
                    || activityInfo.getType() == eActivityType.BowArtActivity.getValue()
                    || activityInfo.getType() == eActivityType.GhostActivity.getValue()
                    || activityInfo.getType() == eActivityType.HangHaiActivity.getValue()
                    || activityInfo.getType() == eActivityType.PawnshopActivity.getValue()
                    || activityInfo.getType() == eActivityType.DrinkActivity.getValue()
                    || activityInfo.getType() == eActivityType.DragonBoatRaceActivity.getValue()
                    || activityInfo.getType() == eActivityType.CelebrationActivity.getValue()
                    || activityInfo.getType() == eActivityType.WinterLoveActivity.getValue()
                    || activityInfo.getType() == eActivityType.YingXinActivity.getValue()
                    || activityInfo.getType() == eActivityType.ShuiHuYeZiCardActivity.getValue()
                    || activityInfo.getType() == eActivityType.SeacraftActivity.getValue()
                    || activityInfo.getType() == eActivityType.PalaceActivity.getValue()
                    || activityInfo.getType() == eActivityType.ToyHouse.getValue()
                    || activityInfo.getType() == eActivityType.ShuShanActivity.getValue()
                    || activityInfo.getType() == eActivityType.MetaSpace.getValue()
                    || activityInfo.getType() == eActivityType.TongBingActivity.getValue()
                    || activityInfo.getType() == eActivityType.TonBingActivity.getValue()
                    || activityInfo.getType() == eActivityType.UnionChest.getValue()
                    || activityInfo.getType() == eActivityType.PaintedEggs.getValue()
                    || activityInfo.getType() == eActivityType.XiaoYuGift.getValue()
                    || activityInfo.getType() == eActivityType.ZhouNianTurntable.getValue()
                    || activityInfo.getType() == eActivityType.MemoryPieces.getValue()
                    || activityInfo.getType() == eActivityType.OperaMask.getValue()
                    || activityInfo.getType() == eActivityType.Pasture.getValue()
                    || activityInfo.getType() == eActivityType.FellingTrees.getValue()
                    || activityInfo.getType() == eActivityType.Tomb.getValue()
                    || activityInfo.getType() == eActivityType.CricketSeasonActivity.getValue()
                    || activityInfo.getType() == eActivityType.WorldCup.getValue()
                    || activityInfo.getType() == eActivityType.PeakStrongHold.getValue()
                    || activityInfo.getType() == eActivityType.NewYearBag.getValue()
                    || activityInfo.getType() == eActivityType.XiuXian.getValue()
                    || activityInfo.getType() == eActivityType.Feast.getValue()
                    || activityInfo.getType() == eActivityType.JieShi.getValue()
                    || activityInfo.getType() == eActivityType.PeakSeacraftActivity.getValue()
                    || activityInfo.getType() == eActivityType.PeerlessBeautyLotteryActivity.getValue()
                    || activityInfo.getType() == eActivityType.DeepFishing.getValue()
                    || activityInfo.getType() == eActivityType.LangYaBang.getValue()
                    || activityInfo.getType() == eActivityType.SilkRoad.getValue()
                    || activityInfo.getType() == eActivityType.SpecialCookBoy.getValue()
                    || activityInfo.getType() == eActivityType.SpecialCookBoySevenSign.getValue()
                    || activityInfo.getType() == eActivityType.FestivalGift.getValue()
                    || activityInfo.getType() == eActivityType.EveFeast.getValue()
                    || activityInfo.getType() == eActivityType.PatronsFund.getValue()
                    || activityInfo.getType() == eActivityType.JinLi.getValue()
                    || activityInfo.getType() == eActivityType.SteleSoul.getValue()
                    || activityInfo.getType() == eActivityType.MusicRoomRank.getValue()
                    || activityInfo.getType() == eActivityType.NewFirstRechargeCash.getValue()
                    || activityInfo.getType() == eActivityType.NewFirstRecharge2024.getValue()
                    || activityInfo.getType() == eActivityType.SnowGarden.getValue()
                    || activityInfo.getType() == eActivityType.ActivityFund.getValue()
                    || activityInfo.getType() == eActivityType.HongXianActivity.getValue()
                    || activityInfo.getType() == eActivityType.SummerGames.getValue()
                    || activityInfo.getType() == eActivityType.SummerQuiz.getValue()
                    || activityInfo.getType() == eActivityType.SoulBoneLottery.getValue()
                    || commonLoadActivityTypeList().contains(activityInfo.getType())
            ) {
                if(isUnFinishActivity(activityInfo)) {//未结束的活动
                    normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                    mallActivityIdList.add(activityInfo.getActivityId());
                    mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                } else {
                    if (!NormalActivityMgr.isActivityAutoSendReward(activityInfo.getActivityId())) {//未发奖的
                        normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                    }
                }
            } else if (activityInfo.getType() == eActivityType.SHARE.getValue()
                    || activityInfo.getType() == eActivityType.FourActivity.getValue()
                    || activityInfo.getType() == eActivityType.TaoBao.getValue()
                    || activityInfo.getType() == eActivityType.ZhangGuiActivity.getValue()
                    || activityInfo.getType() == eActivityType.NewServerWelfareActivity.getValue()
                    || activityInfo.getType() == eActivityType.EggsActivity.getValue()
                    || activityInfo.getType() == eActivityType.AdActivity.getValue()
                    || activityInfo.getType() == eActivityType.RecoveryReward.getValue()
            ) {
                if(isUnFinishActivity(activityInfo)) {//未结束的活动
                    normalActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                }
            }
        }
        List<ActivityInfo> tempAllActivityInfos = new ArrayList<>();
        tempAllActivityInfos.addAll(normalActivityInfoMap.values());
        tempAllActivityInfos.addAll(mallActivityInfoMap.values());
        tempAllActivityInfos.addAll(commonActivityInfoMap.values());
        tempAllActivityInfos.addAll(tradeWarActivityInfoMap.values());
        tempAllActivityInfos.addAll(oreWarActivityInfoMap.values());
        tempAllActivityInfos.addAll(unionWarActivityInfoMap.values());
        tempAllActivityInfos.addAll(StrongholdActivityInfoMap.values());
        tempAllActivityInfos.addAll(relationActivityInfoMap.values());
        allActivityIdList = tempAllActivityInfos.stream().map(ActivityInfo::getActivityId).collect(Collectors.toList());
        Map<Integer, Map<Integer, List<ActivityConditionInfo>>> activityConditionInfoTypeMap = new ConcurrentHashMap<>();
        Map<Integer, List<ActivityConditionInfo>> activityConditionInfoMap = new ConcurrentHashMap<>();
        ActivityBussiness.getActivityConditionInfoMap(activityConditionInfoTypeMap, activityConditionInfoMap, allActivityIdList);
        Map<Integer, Map<Integer, MallInfo>> activityMallInfoMap = ActivityBussiness.getActivityMallInfoMap(mallActivityIdList);
        allActivityMallInfoMap = activityMallInfoMap;
        Map<Integer, Map<String, ActivityConfig>> activityConfigMap = ActivityBussiness.getActivityConfigMap(allActivityIdList);
        allActivityConfigMap = activityConfigMap;

        // 把跨区域的活动也加进来
        ChannelActivityMgr.reloadActivity();
        ChannelActivityMgr.addChannelActivity(normalActivityInfoMap, activityConditionInfoMap, activityMallInfoMap, activityConfigMap);
        for (ActivityInfo activityInfo : normalActivityInfoMap.values()) {
            if (ActivityHelper.isCrossChannelActivityType(activityInfo.getType())) {
                tempAllActivityInfos.add(activityInfo);
                if(activityInfo.getType() == eActivityType.WasheActivity.getValue()){
                    //瓦舍商店用普通商城
                    mallActivityInfoMap.put(activityInfo.getActivityId(), activityInfo);
                }
            }
        }

        allActivityInfos = tempAllActivityInfos;

        NormalActivityMgr.reloadActivityData(normalActivityInfoMap, activityConditionInfoMap, activityMallInfoMap, activityConfigMap);
        MallActivityMgr.reloadActivityData(mallActivityInfoMap, activityMallInfoMap);
        CommonActivityMgr.reloadActivityData(commonActivityInfoMap, activityMallInfoMap, activityConditionInfoTypeMap);
        TradeWarActivityMgr.reloadActivityData(tradeWarActivityInfoMap, activityMallInfoMap, activityConditionInfoTypeMap);
        OreWarActivityMgr.reloadActivityData(oreWarActivityInfoMap, activityMallInfoMap, activityConditionInfoTypeMap);
        HuaShiGangMgr.reloadActivityData(huaShiGangActivityInfoMap);
        FireWorkMgr.reloadActivityData();
        SpringDinnerMgr.reloadActivityData();
        RankUnionWarMgr.reloadActivityData();
        TwinsMgr.reloadActivityData();
        ChineseChessMgr.reloadActivityData();
        HolidayActivityMgr.reloadActivityInfo();
        GamePageantMgr.reloadActivityInfo();
        ThrowingPotMgr.reloadActivityInfo();
        WishPoolMgr.reloadActivityData();
        YearMasterMgr.reloadActivityInfo();
        UnionWarActivityMgr.reloadActivityData(unionWarActivityInfoMap, activityConditionInfoMap, activityConditionInfoTypeMap, activityMallInfoMap, activityConfigMap);
        StrongholdActivityMgr.reloadActivityData(StrongholdActivityInfoMap,activityMallInfoMap,activityConditionInfoTypeMap);
        TreasureActivityMgr.reloadActivityInfo();
        DrawPicturesActivityMgr.reloadActivityInfo();
        ZhanLingActivityMgr.reloadActivityInfo();
        DunHuangShiKuMgr.reloadActivityInfo();

        DaFuWengMgr.reloadActivityData();
        PplMgr.reloadActivityData();
        JianChuangHuaMgr.reloadActivityData();
        TangHuLuMgr.reloadActivityData();
        ShuiHuMgr.reloadActivityData();
        BowArtMgr.reloadActivityData();
        GhostMgr.reloadActivityData();
        SuoYaoMgr.reloadActivityData();
        BusyFarmingMgr.reloadActivityData();
        HangHaiMgr.reloadActivityData();
        DragonBoatRaceMgr.reloadActivityData();
        CelebrationMgr.reloadActivityData();

        PawnshopMgr.reloadActivityData();
        GuGuoXunBaoMgr.reloadActivityData();
        DrinkMgr.reloadActivityData();
        LanRuoSiMgr.reloadActivityData();
        GourdChildMgr.reloadActivityData();
        GourdPlantMgr.reloadActivityData();
        XiaYueMgr.reloadActivityData();
        WinterLoveMgr.reloadActivityData();
        ShareActivityMgr.reloadActivityData();
        FourActivityMgr.reloadActivityData();
        HellMgr.reloadActivityData();
        XiaowuRecallMgr.reloadActivityData();
        DouLuoDaLuMgr.reloadActivityData();
        DouLuoShrekMgr.reloadActivityData();
        OldPlayerReturnMgr.reloadActivityData();

        HongXianActivityMgr.reloadActivityData();
        SoulBoneActivityMgr.reloadActivityData();
        ShuiHuYeZiCardMgr.reloadActivityData();
        TaoBaoMgr.reloadTaoBaoConfig();
        SeacraftSouthSeaMgr.reloadActivityData();

        RelationActivityMgr.reloadActivityData(relationActivityInfoMap, activityMallInfoMap, activityConditionInfoTypeMap);
        MammonHallMgr.reloadActivityData();

        ChannelRankActivityMgr.reloadActivityData();

        YingXinMgr.reloadActivityData();

        SeacraftPirateRiotMgr.reloadActivityData();
        PalaceActivityMgr.reloadActivityData();

        ToyHouseMgr.reloadActivityData();
        ShuShanMgr.reloadActivityData();
        AssistantCostumeMallActivityMgr.reloadActivityData();
        UnionHuaBenActivityMgr.reloadActivityData();

        TongBingMgr.reloadActivityData();
        TonBingMgr.reloadActivityData();
        ChuHanMgr.reloadActivityData();

        MemoryPiecesMgr.reloadActivityData();

        ZhouNianTurntableMgr.reloadActivityData();
        ClimbTowerMgr.reloadActivityData();
        BusinessReunionActivityMgr.reloadActivityData();
        RecallPlayerMgr.reloadActivityData();

        OperaMaskMgr.reloadActivityData();
        GreatTradeMgr.reloadActivityData();

        PastureMgr.reloadActivityData();
        CrossPastureMgr.reloadActivityData();

        AreaWasePkMgr.reloadActivityData();

        LangYaMemorialMgr.reloadActivityData();
        PlatformMailAntiActivityMgr.reloadActivityData();
        PlatformActivityMgr.reloadActivityData();
        NewServerWelfareMgr.reloadActivityData();
        FellingTreesMgr.reloadActivityData();
        TombMgr.reloadActivityData();
        CatMgr.reloadActivityData();

        CarpTripMgr.reloadActivityData();
        FanXiuSpringMgr.reloadActivityData();
        CommonWishMgr.reloadActivityData();

        SpringUnionBanquetMgr.reloadActivityData();
        LionDanceMgr.reloadActivityData();
        WasheMgr.reloadActivityData();
        ChannelTonBingMgr.reloadActivityData();
        SeasonRewardMgr.reloadUserData();
        EggsActivityMgr.reloadActivityData();
        WorldCupMgr.reloadActivityData();

        LuckyDrawMgr.reloadActivityData();
        PeakStrongholdActivityMgr.reloadActivityData();
        ActivityLotteryMgr.reloadActivityData();

        NewYearBagMgr.reloadActivityData();
        XiuXianMgr.reloadActivityData();
        ShanHeFeastMgr.reloadActivityData();
        FlowerCardsMgr.reloadActivityData();
        GoddessMgr.reloadActivityData();
        JieShiMgr.reloadActivityData();
        PeakSeacraftMgr.reloadActivityData();
        SignInDrawActivityMgr.reloadActivityData();
        AdActivityMgr.reloadActivityData();
        AdvertisementActivityMgr.reloadActivityData();
        RecoveryRewardMgr.reloadActivityData();
        CricketMgr.reloadActivityData();
        UnionChestMgr.reloadActivityData();
        DeepFishingMgr.reloadActivityData();

        LangYaBangMgr.reloadActivityData();
        GameUnionActivityGroupMgr.allSyncAble();
        FiveHeroMgr.reloadActivityData();
        SpecialCookBoyMgr.reloadActivityData();
        SpecialCookBoySignMgr.reloadActivityData();

        EnterNameActivityMgr.reloadActivityData();
        SilkRoadMgr.reloadActivityInfo();
        FlowerStudyMgr.reloadActivityData();
        //节日自选礼包
        FestivalGiftMgr.reloadActivityData();
        QixiMgr.reloadActivity();
        GuaGiftsMgr.reloadActivity();

        //节日自选礼包
        FestivalGiftMgr.reloadActivityData();

        XingYouShanShuiMgr.reloadActivityData();

        GoldAutumnMgr.reloadActivityData();
        WanYaoMgr.reloadActivityData();

        DigGoldMgr.reloadActivityData();

        SpecialTombRobMgr.reloadActivityData();
        SpecialTombRobSignMgr.reloadActivityData();

        EveFeastMgr.reloadActivityData();
        //盗墓笔记
        DaoMuActivityMgr.reloadActivityData();
        //新门客基金
        PatronsFundMgr.reloadActivityData();

        WitchDrawMgr.reloadActivityData();

        // 锦鲤签
        JinLiMgr.reloadActivityData();

        // 石碑注魂
        SteleSoulMgr.reloadActivityData();

        MusicRoomRankActivityMgr.reloadActivity();

        // 九州棋局
        JiuZhouMgr.reloadActivityData();

        // 冰雪游园会
        SnowGardenMgr.reloadActivityData();

        // 全副团购
        ActivityMallDayBuyMgr.reloadActivityData();

        refreshCommonFundActivityIdFromConfig();

        LuckyShopMgr.reloadActivityData();

        SummerGamesActivityMgr.reloadActivityData();
        SummerQuizActivityMgr.reloadActivityData();

        RuiShouMgr.reloadActivityData();

        //踏春游记
        DoubleSpringActivityMgr.reloadActivityData();

        PiXiuActivityMgr.reloadActivityData();

        ZhenHuanConfigMgr.reloadActivity();
        ActivityDaySignMgr.reloadActivityData();

        BiaoJuConfigMgr.reloadBiaoJuConfig();

        //花袭春意
        SpringDrawMgr.reloadActivityData();

        // 逐鹿隋唐
        SuiTangMgr.reloadActivityData();

        // QQ游戏大厅特权活动
        QQPrivilegeMgr.reloadActivityData();

        //商途启程
        BusinessDepartMgr.reloadActivityData();

        FoxCardMgr.reloadActivity();;

        // 高山鸣琴
        HarpsMgr.reloadActivityData();

        //通用组队
        CommonTeamMgr.reloadActivityData();

        //山海伏兽
        SonHaiActivityMgr.reloadActivityData();

        //海神岛
        HsIslandActivityMgr.reloadActivityData();

        // 乌龟对对碰
        TurtleMgr.reloadActivityData();

        //小马快跑
        HorseRunMgr.reloadHorseRunConfig();

        //火锅跳棋
        HotpotJumpMgr.reloadActivity();

        // 幸运扭蛋
        GashaponMgr.reloadActivityData();

        // 星星点灯
        StarLightMgr.reloadActivityData();

        // 寒冬馈赠
        IceServerGiftMgr.reloadActivityData();

        //爱徒养成
        ApprenticeMgr.reloadActivityData();

        YuanBaoLotteryMgr.reloadActivity();

        //新财神密卷
        WealthScrollActivityMgr.reloadWealthScrollConfig();

        //厨神争霸一阶段
        ChefDuelPhase1Mgr.reloadChefDuelPhase1Config();

        ActivityChatMgr.activityReload();

        //阳泉酒家 史莱克换皮
        YqHotelMgr.reloadActivityData();

        //通用自选抽奖活动
        SelectLotteryMgr.reloadActivityData();

        //放最后
        ActivityRmbMallTouchMgr.reloadActivityData();

        //跨域妙音坊百花冲榜
        ChannelMusicRoomRankActivityMgr.reloadActivity();

        logger.info("reload activity end");

        sendUnionCrossExpRankOpen();
    }

    /**
     * 通用方式加载活动
     * @return
     */
    private static List<Integer> commonLoadActivityTypeList() {
        List<Integer> commonLoadActivityTypeList = new ArrayList<>();
        commonLoadActivityTypeList.add(eActivityType.AssistantCostumeExchangeMallActivity.getValue());
        commonLoadActivityTypeList.add(eActivityType.BusinessReunion.getValue());
        commonLoadActivityTypeList.add(eActivityType.ZhenHuan.getValue());
        commonLoadActivityTypeList.add(eActivityType.BiaoJu.getValue());
        commonLoadActivityTypeList.add(eActivityType.SuiTang.getValue());
        commonLoadActivityTypeList.add(eActivityType.QQPrivilege.getValue());
        commonLoadActivityTypeList.add(eActivityType.FoxCard.getValue());
        commonLoadActivityTypeList.add(eActivityType.Harps.getValue());
        commonLoadActivityTypeList.add(eActivityType.CombLeaderFund.getValue());
        commonLoadActivityTypeList.add(eActivityType.HorseRun.getValue());
        commonLoadActivityTypeList.add(eActivityType.GoldIngotFund.getValue());
        commonLoadActivityTypeList.add(eActivityType.HotpotJump.getValue());
        commonLoadActivityTypeList.add(eActivityType.YuanBaoLottery.getValue());
        commonLoadActivityTypeList.add(eActivityType.WealthScroll.getValue());
        commonLoadActivityTypeList.add(eActivityType.ChuHanZB.getValue());
        commonLoadActivityTypeList.add(eActivityType.YQHotel.getValue());
        commonLoadActivityTypeList.add(eActivityType.NewPatronsFund.getValue());
        commonLoadActivityTypeList.add(eActivityType.SelectLottery.getValue());
        return commonLoadActivityTypeList;
    }

    /**
     * 需要自动发放奖励的活动
     * @param activityInfo
     * @return
     */
    public static boolean isNeedAutoRewardReChageActivity(ActivityInfo activityInfo) {
        if (isEveryDayReChargeActivity(activityInfo) || isDaysReChargeActivity(activityInfo)) {
            return true;
        }
        return false;
    }

    /**
     * 判断是否是每日充值
     * @param activityInfo
     * @return
     */
    public static boolean isEveryDayReChargeActivity(ActivityInfo activityInfo) {
        if (isMyActivityType(activityInfo, eActivityType.RechargeActivity, eActivityChargeType.EveryDayCharge) ||
                isMyActivityType(activityInfo, eActivityType.RechargeActivity, eActivityChargeType.NewEveryDayCharge) ||
                isMyActivityType(activityInfo, eActivityType.RechargeActivity, eActivityChargeType.EveryDayChargeReplace)){
            return true;
        }
        return false;
    }

    /**
     * 累计充值 累天充值之类的 用于自动发送未领奖的邮件
     * @param activityInfo
     * @return
     */
    public static boolean isDaysReChargeActivity(ActivityInfo activityInfo) {
        if (isMyActivityType(activityInfo, eActivityType.RechargeActivity, eActivityChargeType.AllCharge) ||
                isMyActivityType(activityInfo, eActivityType.RechargeActivity, eActivityChargeType.DaysCharge) ||
                isMyActivityType(activityInfo, eActivityType.RechargeActivity, eActivityChargeType.CanReissueDaysCharge)
        ) {
            return true;
        }

        return false;
    }

    /**
     * 判断是否是自己想要的活动
     * @param activityInfo
     * @param activityType
     * @return
     */
    public static  boolean isMyActivityType(ActivityInfo activityInfo, eActivityType activityType, eActivityChargeType chileType) {
        if (activityInfo.getType() == activityType.getValue() &&
                (activityInfo.getChildType() == chileType.getChildType())) {
            return true;
        }
        return false;
    }


    private static boolean isUnFinishActivity(ActivityInfo activityInfo){
        if(null != activityInfo){
            long nowTime = System.currentTimeMillis() / 1000;
            return activityInfo.getEndShowTime() > nowTime;
        }
        return false;
    }

    private static boolean isNormalRankActivity(ActivityInfo activityInfo){
        if(null != activityInfo){
            if(activityInfo.getType() == eActivityType.RankActivity.getValue() || activityInfo.getType() == eActivityType.UnionRankActivity.getValue()){
                return true;
            }
        }
        return false;
    }

    /**
     * 普通活动
     * @param activityInfo
     * @return
     */
    private static boolean isNormalActivity(ActivityInfo activityInfo){
        if(null != activityInfo){
            if(activityInfo.getType() == eActivityType.RechargeActivity.getValue() || activityInfo.getType() == eActivityType.TaskActivity.getValue() ||
                    activityInfo.getType() == eActivityType.VipActivity.getValue() || activityInfo.getType() == eActivityType.PatronsCombActivity.getValue() ||
                    activityInfo.getType() == eActivityType.WelfareActivity.getValue() || activityInfo.getType() == eActivityType.PlatformActivity.getValue() ||
                    activityInfo.getType() == eActivityType.UnionActivity.getValue() || activityInfo.getType() == eActivityType.CrossRankActivity.getValue() ||
                    activityInfo.getType() == eActivityType.RMBMallActivity.getValue() || activityInfo.getType() == eActivityType.CrossUnionActivity.getValue() ||
                    activityInfo.getType() == eActivityType.MysteriousMerchantActivity.getValue() || activityInfo.getType() == eActivityType.PageantActivity.getValue() ||
                    activityInfo.getType() == eActivityType.VehicleCombActivity.getValue() || activityInfo.getType() == eActivityType.PatronsSkinCombActivity.getValue() ||
                    activityInfo.getType() == eActivityType.WishPoolActivity.getValue() || activityInfo.getType() == eActivityType.NewRechargeActivity.getValue() ||
                    activityInfo.getType() == eActivityType.UnionHuaBenActivity.getValue() || activityInfo.getType() == eActivityType.ActivityLottery.getValue() ||
                    activityInfo.getType() == eActivityType.Zfb.getValue() || activityInfo.getType()==eActivityType.SystemOpenRMBMallActivity.getValue() ||
                    activityInfo.getType() == eActivityType.DragonsEntrance.getValue() || activityInfo.getType() == eActivityType.MailSub37.getValue()
            ){
                return true;
            }
        }
        return false;
    }

    /**
     * 是否冲榜活动的条件
     */
    public static boolean isRankActivityCondition(ActivityInfo activityInfo, int conditionType){
        if(null != activityInfo){
            if(activityInfo.getType() == eActivityType.RankActivity.getValue() || activityInfo.getType() == eActivityType.UnionRankActivity.getValue() ||
                    activityInfo.getType() == eActivityType.CrossRankActivity.getValue() || activityInfo.getType() == eActivityType.CrossUnionActivity.getValue()){
                return true;
            }
            if(activityInfo.getType() == eActivityType.CrossHolidayActivity.getValue() && (conditionType == eGamePlayerEventType.HolidayActivityScoreCrossRank.getValue() ||
                    conditionType == eGamePlayerEventType.HolidayActivityScoreRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.CrossHuaShiGangActivity.getValue() && conditionType == eGamePlayerEventType.HuaShiGangScoreRank.getValue()) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.CrossDunHuangShiKuActivity.getValue() && (conditionType == eGamePlayerEventType.DunHuangShiKuScoreCrossRank.getValue() ||
                    conditionType == eGamePlayerEventType.DunHuangShiKuTeamScoreCrossRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.PageantActivity.getValue()){
                return true;
            }
            if (activityInfo.getType() == eActivityType.ThrowingPotActivity.getValue() && (conditionType == eGamePlayerEventType.ThrowingPotScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.ThrowingPotScoreCrossRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.YearMasterActivity.getValue() && (conditionType == eGamePlayerEventType.YearMasterScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.YearMasterScoreCrossRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.JianChuangHuaActivity.getValue() && (conditionType == eGamePlayerEventType.JianChuangHuaScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.JianChuangHuaScoreCrossRank.getValue())) {
                return true;
            }

            if(activityInfo.getType() == eActivityType.TreasureActivity.getValue() && (conditionType == eGamePlayerEventType.TreasureActivityScoreCrossRank.getValue() ||
                    conditionType == eGamePlayerEventType.TreasureActivityScoreRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.PplActivity.getValue()
                    && (conditionType == eGamePlayerEventType.PplScoreRank.getValue() || conditionType == eGamePlayerEventType.PplScoreCrossRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.YingXinActivity.getValue()
                    && (conditionType == eGamePlayerEventType.YingXinScoreRank.getValue() || conditionType == eGamePlayerEventType.YingXinCrossScoreRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.DaFuWeng.getValue()
                    && (conditionType == eGamePlayerEventType.DaFuWengScoreRank.getValue()
                    || conditionType == eGamePlayerEventType.DaFuWengUnionScoreRank.getValue()
                    || conditionType == eGamePlayerEventType.DaFuWengDamageRank.getValue()
                    || conditionType == eGamePlayerEventType.DaFuWengUnionDamageRank.getValue())) {
                return true;
            }
            if(activityInfo.getType() == eActivityType.DrawPicturesActivity.getValue() && (conditionType == eGamePlayerEventType.DrawPicturesIntegralCrossRank.getValue() ||
                    conditionType == eGamePlayerEventType.DrawPicturesIntegralRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.TangHuluActivity.getValue()
                    && (conditionType == eGamePlayerEventType.TangHuLuScoreRank.getValue() || conditionType == eGamePlayerEventType.TangHuLuScoreCrossRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.ShuiHuActivity.getValue() &&
                    conditionType == eGamePlayerEventType.ShuiHuScoreRank.getValue()) {
                return true;
            }
            if(activityInfo.getType() == eActivityType.BowArtActivity.getValue()
                    && (conditionType == eGamePlayerEventType.BowArtActivityScoreRank.getValue())
                    || conditionType == eGamePlayerEventType.BowArtActivityScoreCrossRank.getValue()
                    || conditionType == eGamePlayerEventType.BowArtActivityServerScoreRank.getValue()
                    || conditionType == eGamePlayerEventType.BowArtActivityUnionScoreRank.getValue()
                    || conditionType == eGamePlayerEventType.BowArtActivityUnionScoreCrossRank.getValue()){
                return true;
            }
            if (activityInfo.getType() == eActivityType.GhostActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.GhostScoreRank.getValue() || conditionType == eGamePlayerEventType.GhostUnionScoreRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.SuoYaoActivity.getValue() &&
                    conditionType == eGamePlayerEventType.SuoYaoScoreRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.BusyFarmingActivity.getValue()
                    && (conditionType == eGamePlayerEventType.BusyFarmingScoreCrossRank.getValue() || conditionType == eGamePlayerEventType.BusyFarmingScoreRank.getValue())) {
                return true;
            }
            if(activityInfo.getType() == eActivityType.PawnshopActivity.getValue() && (conditionType == eGamePlayerEventType.PawnshopScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.PawnshopScoreCrossRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.HangHaiActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.HangHaiUnionMoneyRank.getValue() || conditionType == eGamePlayerEventType.HangHaiMoneyRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.GuGuoXunBaoActivity.getValue()
                    && (conditionType == eGamePlayerEventType.GuGuoXunBaoClueNumCrossRank.getValue() || conditionType == eGamePlayerEventType.GuGuoXunBaoClueNumRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.DrinkActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.DrinkActivityScoreRank.getValue() ||
                            conditionType == eGamePlayerEventType.DrinkActivityCrossScoreRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.LanRuoSiActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.LanRuoSiActivityScoreRank.getValue() ||
                            conditionType == eGamePlayerEventType.LanRuoSiActivityCrossScoreRank.getValue())){
                return true;
            }
            if(activityInfo.getType() == eActivityType.DragonBoatRaceActivity.getValue() &&
                            (conditionType == eGamePlayerEventType.DragonBoatRaceActivityScoreRank.getValue()
                            || conditionType == eGamePlayerEventType.DragonBoatRaceActivityScoreCrossRank.getValue()
                            || conditionType == eGamePlayerEventType.DragonBoatRaceActivityUnionScoreRank.getValue()
                            || conditionType == eGamePlayerEventType.DragonBoatRaceActivityUnionScoreCrossRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.XiaYueActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.XiaYueScoreRank.getValue() || conditionType == eGamePlayerEventType.XiaYueCrossScoreRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.CookingBoyActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.CookBoy1IntegralUserCrossRank.getValue()
                            || conditionType == eGamePlayerEventType.CookBoy1IntegralUnionCrossRank.getValue()
                            || conditionType == eGamePlayerEventType.CookBoy2IntegralUserCrossRank.getValue()
                            || conditionType == eGamePlayerEventType.CookBoy3IntegralUserCrossRank.getValue()
                            || conditionType == eGamePlayerEventType.CookBoy1IntegralServerCrossRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.ChefDuel.getValue() &&
                    (
//                            conditionType == eGamePlayerEventType.ChefDuel1IntegralUserCrossRank.getValue()
//                            || conditionType == eGamePlayerEventType.ChefDuel1IntegralUnionCrossRank.getValue()
                             conditionType == eGamePlayerEventType.ChefDuel2IntegralUserCrossRank.getValue()
                            || conditionType == eGamePlayerEventType.ChefDuel3IntegralUserCrossRank.getValue()
//                            || conditionType == eGamePlayerEventType.ChefDuel1IntegralServerCrossRank.getValue()
                    )) {
                return true;
            }

            if(activityInfo.getType() == eActivityType.CelebrationActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.CelebrationActivityScoreRank.getValue() || conditionType == eGamePlayerEventType.CelebrationActivityScoreCrossRank.getValue())) {
                return true;
            }
            if(activityInfo.getType() == eActivityType.GourdChildActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.GourdChildDamageRank.getValue() || conditionType == eGamePlayerEventType.GourdChildPassProgressRank.getValue() ||
                            conditionType == eGamePlayerEventType.GourdChildDamageCrossRank.getValue() || conditionType == eGamePlayerEventType.GourdChildPassProgressCrossRank.getValue() ||
                            conditionType == eGamePlayerEventType.GourdPlantScoreRank.getValue() || conditionType == eGamePlayerEventType.GourdPlantScoreCrossRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.WinterLoveActivity.getValue()&&
                    (conditionType==eGamePlayerEventType.WinterLoveRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.HellActivity.getValue()
                    && (conditionType == eGamePlayerEventType.HellActivityScoreRank.getValue() || conditionType == eGamePlayerEventType.HellActivityScoreCrossRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.DouLuoShrekActivity.getValue()
                    && (conditionType == eGamePlayerEventType.DouLuoShrekActivityScoreCrossRank.getValue() || conditionType == eGamePlayerEventType.DouLuoShrekActivityScoreCrossRank2.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.YQHotel.getValue()
                    && (conditionType == eGamePlayerEventType.YQHotelPersonalScoreRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.SpringDinner.getValue()
                    && (conditionType == eGamePlayerEventType.SpringDinnerScoreCrossRank.getValue() ||
                    conditionType == eGamePlayerEventType.SpringDinnerMaxScoreCrossRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.ChineseChess.getValue()
                    && (conditionType == eGamePlayerEventType.ChineseChessTopScoreRank.getValue())) {
                return true;
            }
            //癫疯商会战排行榜类型
            if (activityInfo.getType() == eActivityType.RankUnionWar.getValue()
                    && (conditionType == eGamePlayerEventType.RankUnionWarUnionScoreRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.Twins.getValue()
                    && (conditionType == eGamePlayerEventType.TwinsUserScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.TwinsUnionScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.TwinsPassDamageRank.getValue())) {
                return true;
            }
            if(activityInfo.getType() == eActivityType.DouLuoDaLuActivity.getValue() && (
                    conditionType == eGamePlayerEventType.DouLuoDaLuPhaseOneUserScoreCrossRank.getValue() || conditionType == eGamePlayerEventType.DouLuoDaLuPhaseTwoUserScoreCrossRank.getValue() ||
                            conditionType == eGamePlayerEventType.DouLuoDaLuPhaseTwoTeamScoreCrossRank.getValue())){
                return true;
            }

            eRankInfo rankInfo = eRankInfo.getERankInfo(activityInfo.getType(), activityInfo.getChildType(), conditionType);
            if (rankInfo != null) {
                return true;
            }

            if(activityInfo.getType() == eActivityType.ShuiHuYeZiCardActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.ShuiHuYeZiCardScoreRank.getValue() || conditionType == eGamePlayerEventType.ShuiHuYeZiCardTotalCardLevelRank.getValue())){
                return true;
            }

            if(activityInfo.getType() == eActivityType.SeacraftActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.SeacraftSouthSeaUserScoreRank.getValue() || conditionType == eGamePlayerEventType.SeacraftSouthSeaUnionRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.SeacraftActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.SeacraftPirateRiotScoreRank.getValue() || conditionType == eGamePlayerEventType.SeacraftPirateRiotUnionScoreRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.ToyHouse.getValue() && conditionType == eGamePlayerEventType.ToyHouseCrossScoreRank.getValue()) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.ShuShanActivity.getValue() && conditionType == eGamePlayerEventType.ShuShanMaxMagicUserRank.getValue()){
                return true;
            }

            if (activityInfo.getType() == eActivityType.TongBingActivity.getValue() && (
                    conditionType == eGamePlayerEventType.TongBingUserZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.TongBingCampUnionZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.TongBingCampScoreRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.TonBingActivity.getValue() && (
                    conditionType == eGamePlayerEventType.TonBingUserZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.TonBingCampUnionZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.TonBingCampScoreRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.ChannelTonBingActivity.getValue() && (
                    conditionType == eGamePlayerEventType.TonBingUserZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.TonBingCampUnionZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.TonBingCampScoreRank.getValue())){
                return true;
            }
            if (activityInfo.getType() == eActivityType.ChuHanZB.getValue() && (
                    conditionType == eGamePlayerEventType.ChuHanUserZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.ChuHanCampUnionZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.ChuHanCampScoreRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.SuiTang.getValue() && (
                    conditionType == eGamePlayerEventType.SuiTangUserZhanGongRank.getValue() ||
                            conditionType == eGamePlayerEventType.SuiTangUnionScoreRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.Harps.getValue() && conditionType == eGamePlayerEventType.HarpsScoreRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.ZhouNianTurntable.getValue() && conditionType == eGamePlayerEventType.ZhouNianTurntableScoreRank.getValue()) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.ClimbTower.getValue() && conditionType == eGamePlayerEventType.ClimbTowerCellNumCrossRank.getValue()){
                return true;
            }

            if (activityInfo.getType() == eActivityType.OperaMask.getValue() && conditionType == eGamePlayerEventType.OperaMaskSumScoreRank.getValue()) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.FellingTrees.getValue() && conditionType == eGamePlayerEventType.FellingTreesLevelRank.getValue()) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.GreatTradeActivity.getValue() && (conditionType == eGamePlayerEventType.GreatTradeAssetCrossRank.getValue()
                    || conditionType == eGamePlayerEventType.GreatTradePrestigeCrossRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.Pasture.getValue() && conditionType == eGamePlayerEventType.PastureMaxScoreRank.getValue()) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.Tomb.getValue() && (conditionType == eGamePlayerEventType.TombUserRank.getValue() || conditionType == eGamePlayerEventType.TombUnionRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.Cat.getValue() && (conditionType == eGamePlayerEventType.CatActivityPassRank.getValue() || conditionType == eGamePlayerEventType.CatActivityDamageRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.CarpTripActivity.getValue() && (conditionType == eGamePlayerEventType.CarpTripCellNumCrossRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.WorldCup.getValue() && conditionType == eGamePlayerEventType.WorldCupScoreRank.getValue()){
                return true;
            }

            if (activityInfo.getType() == eActivityType.FanXiuSpringActivity.getValue() && conditionType == eGamePlayerEventType.FanXiuSpringScoreRank.getValue()){
                return true;
            }

            if (activityInfo.getType() == eActivityType.CommonWishDraw.getValue() && conditionType == eGamePlayerEventType.CommonWishScoreRank.getValue()){
                return true;
            }

            if (activityInfo.getType() == eActivityType.PeakStrongHold.getValue()
                    &&
                    (conditionType == eGamePlayerEventType.PeakStrongHoldUserDamageRank.getValue() ||
                    conditionType == eGamePlayerEventType.PeakStrongHoldUnionIntegralRank.getValue())
            ) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.LionDance.getValue() && (conditionType == eGamePlayerEventType.LionDanceScoreRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.FireWork2023.getValue()
                    && (conditionType == eGamePlayerEventType.FireWorkScoreRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.FlowerCards.getValue() && conditionType == eGamePlayerEventType.FlowerCardCrossScoreRank.getValue()){
                return true;
            }
            if (activityInfo.getType() == eActivityType.JieShi.getValue()
                    && (conditionType == eGamePlayerEventType.JieShiJiaoZiRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.XiuXian.getValue() && (
                    conditionType == eGamePlayerEventType.XiuXianPersonalScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.XiuXianSectScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.XiuXianXianLiRank.getValue()
            )) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.Feast.getValue() && (
                    conditionType == eGamePlayerEventType.FeastPersonalScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.FeastXianLiRank.getValue()
            )) {
                return true;
            }

            if(activityInfo.getType() == eActivityType.PeakSeacraftActivity.getValue() &&
                    (conditionType == eGamePlayerEventType.PeakSeacraftUserScoreRank.getValue() || conditionType == eGamePlayerEventType.PeakSeacraftUnionRank.getValue())){
                return true;
            }
            if(activityInfo.getType() == eActivityType.GoddessActivity.getValue() && conditionType == eGamePlayerEventType.GoddessMissionRank.getValue()){
                return true;
            }

            if(activityInfo.getType() == eActivityType.LangYaMemorial.getValue() && conditionType == eGamePlayerEventType.LangYaMemorialCrossRank.getValue()){
                return true;
            }

            if (activityInfo.getType() == eActivityType.PeerlessBeautyLotteryActivity.getValue()
                    && (conditionType == eGamePlayerEventType.PeerlessBeautyLotteryRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.DeepFishing.getValue() && conditionType == eGamePlayerEventType.DeepFishingTotalCoinRank.getValue()){
                return true;
            }
            if (activityInfo.getType() == eActivityType.FiveHero.getValue() &&
            (conditionType == eGamePlayerEventType.FiveHeroUserPopularityRank.getValue() || conditionType == eGamePlayerEventType.FiveHeroCampUnionPopularityRank.getValue())){
                return true;
            }

            if (activityInfo.getType() == eActivityType.CrossPasture.getValue()
                    && (conditionType == eGamePlayerEventType.EnterNameAreaFightRank.getValue() ||
                    conditionType == eGamePlayerEventType.ChannelPastureMaxScoreRank.getValue())) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.LangYaBang.getValue() && (conditionType == eGamePlayerEventType.LangYaUnionScoreRank.getValue() || conditionType == eGamePlayerEventType.LangYaUserBuildingCoinRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.SilkRoad.getValue() && conditionType == eGamePlayerEventType.SilkRoadUserScoreRank.getValue()) {
                return true;
            }
            //盗墓笔记
            if (activityInfo.getType() == eActivityType.DaoMu.getValue()) {
                if (conditionType == eGamePlayerEventType.DaoMuPvePersonRank.getValue() || conditionType == eGamePlayerEventType.DaoMuPvpPersonRank.getValue()) {
                    return true;
                }
            }
            if (activityInfo.getType() == eActivityType.FlowerStudy.getValue() && (conditionType == eGamePlayerEventType.FlowerStudyScoreLocalRankCondition.getValue()
                    || conditionType == eGamePlayerEventType.FlowerStudyScoreProvinceRankCondition.getValue()
                    || conditionType == eGamePlayerEventType.FlowerStudyScorePalaceRankCondition.getValue())) {
                return true;
            }
            if (activityInfo.getType()==eActivityType.QiXiActivity.getValue() && conditionType == eGamePlayerEventType.QixiUserRank.getValue()){
                return true;
            }

            if (conditionType == eGamePlayerEventType.GuaGiftsNobleRank.getValue() || conditionType == eGamePlayerEventType.GuaGiftsGuaRank.getValue() ){
                return true;
            }

            if (activityInfo.getType() == eActivityType.WanYao.getValue() && conditionType == eGamePlayerEventType.WanYaoUserPowerRank.getValue()) {
                return true;
            }
            if (activityInfo.getType() == eActivityType.DigGold.getValue() && conditionType == eGamePlayerEventType.DigGoldScoreRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.GoldAutumn.getValue() && conditionType == eGamePlayerEventType.GoldAutumnScoreCrossRank.getValue()){
                return true;
            }

            if (activityInfo.getType() == eActivityType.EveFeast.getValue() && conditionType == eGamePlayerEventType.EveFeastUserRank.getValue()) {
                return true;
            }

            //瓦舍地域
            if (activityInfo.getType() == eActivityType.AreaWashePkActivity.getValue()
                    && (conditionType == eGamePlayerEventType.WaShePkAllGroupFightRank.getValue() ||
                    conditionType == eGamePlayerEventType.WaShePkGroupFightRank.getValue()) ||
                    conditionType == eGamePlayerEventType.WaShePkUserFightRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.WitchDraw.getValue() && conditionType == eGamePlayerEventType.WitchDrawScoreRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.SteleSoul.getValue() && conditionType == eGamePlayerEventType.SteleSoulRoundRank.getValue()) {
                return true;
            }
            //九州
            if (activityInfo.getType() == eActivityType.JiuZhou.getValue() && (conditionType == eGamePlayerEventType.JiuZhouEliteOutRoundRank.getValue()
                    || conditionType == eGamePlayerEventType.JiuZhouEliteScoreRoundRank.getValue()
                    || conditionType == eGamePlayerEventType.JiuZhouMasterScoreRoundRank.getValue()
                    || conditionType == eGamePlayerEventType.JiuZhouMasterOutRoundRank.getValue()
                    || conditionType == eGamePlayerEventType.JiuZhouKingScoreRoundRank.getValue()
                    ||  conditionType == eGamePlayerEventType.JiuZhouKingOutRoundRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.MusicRoomRank.getValue() && (
                    conditionType == eGamePlayerEventType.MusicRoomScoreRank.getValue()
                            || conditionType == eGamePlayerEventType.ServerMusicRoomScoreRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.SnowGarden.getValue()
                    && (conditionType == eGamePlayerEventType.SnowGardenScoreRank.getValue() ||
                    conditionType == eGamePlayerEventType.SnowGardenSecondScoreRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.RuiShou.getValue()
                    && conditionType == eGamePlayerEventType.RuiShouScoreRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.ZhenHuan.getValue() &&
                    (conditionType == eGamePlayerEventType.ZhenHuanFirstProcessRank.getValue() ||
                            conditionType == eGamePlayerEventType.ZhenHuanSecondProcessRank.getValue() ||
                            conditionType == eGamePlayerEventType.ZhenHuanThirdProcessRank.getValue())) {
                return true;
            }
            //花袭春意
            if (activityInfo.getType() == eActivityType.SpringDraw.getValue() && conditionType == eGamePlayerEventType.SpringDrawScoreRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.HongXianActivity.getValue() && conditionType == eGamePlayerEventType.HongXianUserRank.getValue()) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.SummerGames.getValue() && (conditionType == eGamePlayerEventType.SummerGamesEntryScoreRank.getValue())) {
                return true;
            }

            if (activityInfo.getType() == eActivityType.BiaoJu.getValue() &&
                    (conditionType == eGamePlayerEventType.BiaoJuExpRank.getValue() || conditionType == eGamePlayerEventType.BiaoJuUnionExpRank.getValue())) {
                return true;
            }

            if (conditionType == eGamePlayerEventType.FoxCardTreeScoreRank.getValue() || conditionType == eGamePlayerEventType.FoxCardMaxOnceDamageRank.getValue()) {
                return true;
            }

            //山海伏兽
            if (activityInfo.getType() == eActivityType.SonHai.getValue() && (conditionType == eGamePlayerEventType.SonHaiUserRank.getValue() || conditionType == eGamePlayerEventType.SonHaiTeamRank.getValue())) {
                return true;
            }

            //海神岛
            if (activityInfo.getType() == eActivityType.HsIsland.getValue()
                    && (conditionType == eGamePlayerEventType.HsIslandUserRank.getValue() || conditionType == eGamePlayerEventType.HsIslandUnionRank.getValue())) {
                return true;
            }

            // 乌龟对对碰
            if (activityInfo.getType() == eActivityType.Turtle.getValue() && conditionType == eGamePlayerEventType.TurtleUserRank.getValue()) {
                return true;
            }

            //小马快跑
            if (activityInfo.getType() == eActivityType.HorseRun.getValue() && (conditionType == eGamePlayerEventType.HorseRunPersonalGradeRank.getValue() || conditionType == eGamePlayerEventType.HorseRunUnionRacingScoreRank.getValue()) ){
                return true;
            }


            if (conditionType == eGamePlayerEventType.HotpotJumpScoreRank.getValue()) {
                return true;
            }

            // 幸运扭蛋
            if (activityInfo.getType() == eActivityType.Gashapon.getValue() && conditionType == eGamePlayerEventType.GashaponUserRank.getValue()) {
                return true;
            }

            //爱徒养成
            if (activityInfo.getType() == eActivityType.Apprentice.getValue() && conditionType == eGamePlayerEventType.ApprenticeScoreRank.getValue()) {
                return true;
            }

            //行游山水
            if (activityInfo.getType() == eActivityType.XingYouShanShui.getValue() && (conditionType == eGamePlayerEventType.XingYouShanShuiTeamSliverRank.getValue() || conditionType == eGamePlayerEventType.XingYouShanShuiUserSliverRank.getValue())) {
                return true;
            }

            //厨神争霸一阶段
            if (activityInfo.getType() == eActivityType.ChefDuel.getValue() && activityInfo.getChildType() == eChefDuelActivityType.Phase1.getChildType()){
                if (conditionType == eGamePlayerEventType.ChefDuel1StageScoreRank.getValue() || conditionType == eGamePlayerEventType.ChefDuelPhase1UnlimitedRank.getValue()) {
                    return true;
                }
            }

            //阳泉酒家
            if (activityInfo.getType() == eActivityType.YQHotel.getValue() && conditionType == eGamePlayerEventType.YQHotelPersonalScoreRank.getValue()){
                return true;
            }

            //跨域妙音坊冲榜
            if (activityInfo.getType() == eActivityType.ChannelMusicRoomRank.getValue()){
                if (conditionType == eGamePlayerEventType.MusicRoomScoreRank.getValue() || conditionType == eGamePlayerEventType.ServerMusicRoomScoreRank.getValue()) {
                    return true;
                }
            }

        }
        return false;
    }

    /**
     * 一亿目标活动是否过期
     */
    public static boolean isPatronsAbilityActivityOverTime(GamePlayer player, ActivityInfo activityInfo){
        if(null == activityInfo){
            return false;
        }
        if(activityInfo.getType() == eActivityType.WelfareActivity.getValue() && activityInfo.getChildType() == eWelfareActivityType.PatronsAbility.getValue()) {
            int offsetDay = DateHelper.calc2DateTDOADays(new Date(player.getUserInfo().getRegisterTime() * 1000), new Date());
            return offsetDay > Integer.parseInt(activityInfo.getParam6());
        }else {
            return false;
        }
    }

    /**
     * 活动在展示期间
     */
    public static boolean activityInShowTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime >= activityInfo.getBeginShowTime() && nowTime < activityInfo.getEndShowTime();
    }
    /**
     * 活动结束了
     *     //改成活动所有期间都会触发，但是活动领奖期要求解散踢人不会改变领奖状态，在触发器里在判断一下时间
     */
    public static boolean activityOver(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return true;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime >= activityInfo.getEndTime() && nowTime < activityInfo.getEndShowTime();
    }

    /**
     * 活动在可加载期间
     */
    public static boolean activityInLoadTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        //提前24小时载入活动
        return nowTime >= (activityInfo.getBeginShowTime() - DateHelper.DAY_SECONDS) && nowTime < activityInfo.getEndShowTime();
    }

    /**
     * 商会活动可加载期间
     */
    public static boolean unionActivityInLoadTime(ActivityInfo activityInfo) {
        if(activityInLoadTime(activityInfo)){
            return activityInfo.getType() == eActivityType.UnionRankActivity.getValue() || activityInfo.getType() == eActivityType.UnionActivity.getValue();
        }
        return false;
    }

    /**
     * 跨服商会活动可加载期间
     */
    public static boolean crossUnionActivityInLoadTime(ActivityInfo activityInfo) {
        if(activityInLoadTime(activityInfo)){
            return activityInfo.getType() == eActivityType.CrossUnionActivity.getValue();
        }
        return false;
    }

    /**
     * 大富翁活动在加载期
     */
    public static boolean daFuWengActivityInLoadTime(ActivityInfo activityInfo) {
        if (activityInShowTime(activityInfo)) {
            return activityInfo.getType() == eActivityType.DaFuWeng.getValue();
        }
        return false;
    }

    public static boolean monopolyRankActivityCanAddTime(ActivityInfo activityInfo) {
        if (activityInfo == null) {
            return false;
        }
        long now = System.currentTimeMillis() / 1000;
        return activityInfo.getBeginTime() <= now && activityInfo.getEndTime() + (DateHelper.MINUTE_SECONDS * 5) > now;
    }

    //在活动展示结束前都可以买的活动
    public static boolean isEndShowTimeCanBuyActivity(ActivityInfo activityInfo){
        if(activityInfo.getType() == eActivityType.ChineseChess.getValue()){
            return true;
        }
        if (activityInfo.getType() == eActivityType.Pasture.getValue()) {
            return true;
        }
        if(activityInfo.getType() == eActivityType.GreatTradeActivity.getValue()){
            return true;
        }
        if(activityInfo.getType() == eActivityType.FlowerCards.getValue()){
            return true;
        }
        if(activityInfo.getType() == eActivityType.OperaMask.getValue()){
            return true;
        }
        if(activityInfo.getType() == eActivityType.EveFeast.getValue()){
            return true;
        }

        if(activityInfo.getType() == eActivityType.ZhenHuan.getValue()){
            return true;
        }
        if(activityInfo.getType() == eActivityType.BusinessDepart.getValue()){
            return true;
        }
        return false;
    }

    /**
     * 活动进行时间
     */
    public static boolean activityInTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long now = System.currentTimeMillis() / 1000;
        return activityInfo.getBeginTime() <= now && activityInfo.getEndTime() > now;
    }

    /**
     * 活动进行时间和领奖期间
     */
    public static boolean activityInTimeAndShowTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long now = System.currentTimeMillis() / 1000;
        return activityInfo.getBeginTime() <= now && activityInfo.getEndShowTime() > now;
    }


    /**
     * 活动展示期到活动显示结束期 [beginTime,endShowTime)
     */
    public static boolean activityInBeginTimeBetweenEndShowTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long now = System.currentTimeMillis() / 1000;
        return activityInfo.getBeginTime() <= now && activityInfo.getEndShowTime() > now;
    }

    /**
     * 活动进行时间往后20分钟时间用来结算
     */
    public static boolean activityInTime20Min(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long now = System.currentTimeMillis() / 1000;
        return activityInfo.getBeginTime() <= now && activityInfo.getEndTime() + 20 * 60 > now;
    }

    /**
     * 自动发放奖励记录活动时间
     */
    public static boolean activityInRecordTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long now = System.currentTimeMillis() / 1000;
        return activityInfo.getBeginTime() <= now && activityInfo.getEndShowTime() > now;
    }

    /**
     * 活动展示期间
     */
    public static boolean activityInShowPeriod(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime >= activityInfo.getBeginShowTime() && nowTime < activityInfo.getBeginTime();
    }

    /**
     * 活动领奖期间
     */
    public static boolean activityInRewardPeriod(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime >= activityInfo.getEndTime() && nowTime < activityInfo.getEndShowTime();
    }

    /**
     * 展示期后，结束期前
     */
    public static boolean activityBeforeEndTime(ActivityInfo activityInfo) {
        if (null == activityInfo) {
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime >= activityInfo.getBeginShowTime() && nowTime < activityInfo.getEndTime();
    }

    /**
     * 活动可领奖期间，活动结束5分钟开始领奖
     */
    public static boolean activityInCanRewardPeriod(ActivityInfo activityInfo){
        if(null == activityInfo){
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime >= activityInfo.getEndTime() + 300 && nowTime < activityInfo.getEndShowTime();
    }

    /**
     * 活动到期
     */
    public static boolean activityOverTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime > activityInfo.getEndShowTime() + 300;
    }

    /**
     * 活动到领奖期
     */
    public static boolean activityOverEndTime(ActivityInfo activityInfo) {
        if(null == activityInfo){
            return false;
        }
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime > activityInfo.getEndTime() + 300;
    }

    public static String getActivityName(ActivityInfo activityInfo, String language){
        if(null == activityInfo){
            return "";
        }
        return ServerLanguageMgr.getContent(activityInfo.getActivityName(), language);
    }

    public static MallActivityInfo parseMallActivityInfo(ActivityInfo activityInfo){
        MallActivityInfo mallActivityInfo = new MallActivityInfo();
        mallActivityInfo.setActivityId(activityInfo.getActivityId());
        mallActivityInfo.setActivityName(activityInfo.getActivityName());
        mallActivityInfo.setBeginTime(activityInfo.getBeginTime());
        mallActivityInfo.setEndTime(activityInfo.getEndTime());
        mallActivityInfo.setType(activityInfo.getType());
        mallActivityInfo.setChildType(activityInfo.getChildType());
        return mallActivityInfo;
    }

    public static UserActivityConditionData initUserActivityConditionData(GamePlayer player, ActivityConditionInfo conditionInfo) {
        UserActivityConditionData data = new UserActivityConditionData();
        data.setUserId(player.getUserId());
        data.setActivityId(conditionInfo.getActivityId());
        data.setConditionId(conditionInfo.getConditionId());
        data.setType(conditionInfo.getType());
        data.setValue(BigInteger.ZERO);
        data.setPreValue(BigInteger.ZERO);
        data.setModifyTime(System.currentTimeMillis() / 1000);
        data.setGetReward(false);
        data.setInsertOption();
        return data;
    }

    /**
     * 获取我的跨服排名
     */
    public static int getMyCrossRank(long userId, RankProto.RankListMsg.Builder rankListMsg) {
        List<RankProto.RankTempMsg> rankList = rankListMsg.getRankListList();
        for (int i = 0; i < rankList.size(); i++) {
            RankProto.RankTempMsg rankDataMsg = rankList.get(i);
            if (rankDataMsg.getUserId() == userId && rankDataMsg.getPlayerBaseData().getServerId() == GameServer.getInstance().getServerId()) {
                return i + 1;
            }
        }
        return -1;
    }

    /**
     * 获取我的跨服排名
     */
    public static int getMyCrossUnionRank(String unionUid, UnionActivityRankProto.UnionActivityRankListMsg.Builder rankListMsg) {
        List<UnionActivityRankProto.UnionActivityRankTempMsg> rankList = rankListMsg.getRankListList();
        for (int i = 0; i < rankList.size(); i++) {
            UnionActivityRankProto.UnionActivityRankTempMsg rankDataMsg = rankList.get(i);
            if (Objects.equals(rankDataMsg.getUnionUid(), unionUid)) {
                return i + 1;
            }
        }
        return -1;
    }

    /**
     * 跨服冲榜活动能够全部上传排行数据，在活动结束后的4分钟内
     */
    public static boolean crossRankActivityCanAllSync(ActivityInfo activityInfo) {
        if (null != activityInfo) {
            long nowTime = System.currentTimeMillis() / 1000;
            return nowTime >= activityInfo.getEndTime() && nowTime - activityInfo.getEndTime() < 200;
        }
        return false;
    }

    /**
     * 是否是战令活动
     * @param activityInfo
     * @return
     */
    public static boolean isZhanLingActivity(ActivityInfo activityInfo) {
        if (activityInfo.getType() == eActivityType.WelfareActivity.getValue()) {
            return activityInfo.getChildType() == eWelfareActivityType.ZhanLingMeiLi.getValue()
                    || activityInfo.getChildType() == eWelfareActivityType.ZhanLingQinMi.getValue()
                    || activityInfo.getChildType() == eWelfareActivityType.ZhanLingMenKe.getValue()
                    || activityInfo.getChildType() == eWelfareActivityType.ZhanLingZhuanSu.getValue()
                    || activityInfo.getChildType() == eWelfareActivityType.ZhanLingYuanBao.getValue();
        }
        return false;
    }

//    public static CommonActivityInfo parseCommonActivityInfo(ActivityInfo activityInfo){
//        CommonActivityInfo commonActivityInfo = new CommonActivityInfo();
//        commonActivityInfo.setActivityId(activityInfo.getActivityId());
//        commonActivityInfo.setActivityName(activityInfo.getActivityName());
//        commonActivityInfo.setActivityDesc(activityInfo.getActivityDesc());
//        commonActivityInfo.setType(activityInfo.getType());
//        commonActivityInfo.setChildType(activityInfo.getChildType());
//        commonActivityInfo.setBeginShowTime(activityInfo.getBeginShowTime());
//        commonActivityInfo.setBeginTime(activityInfo.getBeginTime());
//        commonActivityInfo.setEndTime(activityInfo.getEndTime());
//        commonActivityInfo.setEndShowTime(activityInfo.getEndShowTime());
//        commonActivityInfo.setResourceDir(activityInfo.getParam1());
//        commonActivityInfo.setScoreItem(Integer.parseInt(activityInfo.getParam2()));
//        commonActivityInfo.setActivityItemStr(activityInfo.getParam3());
//        commonActivityInfo.setActivityItemList(StringUtils.stringToIntegerList(commonActivityInfo.getActivityItemStr(), "\\|"));
//        commonActivityInfo.setUseItemDesc(activityInfo.getParam4());
//        commonActivityInfo.setResourceParam(activityInfo.getParam5());
//        return commonActivityInfo;
//    }

    /**
     * 读取过期的最后一个活动的名称
     */
  /*  public static String getLastExpireActivityName(long serverId, int type, int childType) {
        ActivityInfo lastActivityInfo = null;
        long now = System.currentTimeMillis() / 1000;
        Map<Integer, ActivityInfo> activityInfoMap = ActivityBussiness.getExpireActivityInfoMapByType(serverId, type, childType);
        for (ActivityInfo activityInfo : activityInfoMap.values()) {
            lastActivityInfo = lastActivityInfo == null ? activityInfo : lastActivityInfo;
            if (lastActivityInfo.getEndShowTime() < activityInfo.getEndShowTime() && lastActivityInfo.getEndShowTime() <= now) {
                lastActivityInfo = activityInfo;
            }
        }
        if (lastActivityInfo != null) {
            return lastActivityInfo.getActivityName();
        }
        return "";
    }*/

    public static List<ActivityInfo> getAllActivityInfos() {
        return allActivityInfos;
    }

    /**
     * 是否在补签时间内
     * @param activityInfo
     * @return
     */
    public static boolean isInRechargeActivityReissueTime(ActivityInfo activityInfo){
        if(null == activityInfo){
            return false;
        }
        String param6 = activityInfo.getParam6();
        String[] dataArr = param6.split("\\|");
        int data1 = Integer.parseInt(dataArr[0]);
        long nowTime = System.currentTimeMillis() / 1000;
        return nowTime >= activityInfo.getBeginTime() && nowTime >= activityInfo.getEndTime() - data1 * DateHelper.DAY_SECONDS &&
                nowTime < activityInfo.getEndTime();
    }

    /**
     * 获取全部活动商品信息（过期活动商品需要自己判断）
     * @return
     */
    public static Map<Integer, Map<Integer, MallInfo>> getAllActivityMallInfoMap(){
        return allActivityMallInfoMap;
    }

    public static boolean isNewRechargeActivity(int activityId) {
        ActivityInfo activityInfo = NormalActivityMgr.getActivityInfo(activityId);
        if (activityInfo == null) {
            return false;
        }
        return activityInfo.getType() == eActivityType.NewRechargeActivity.getValue();
    }

    private static void sendUnionCrossExpRankOpen() {
        ActivityInfo activityInfo = getUnionExpRiseRankActivity();
        if(activityInfo != null){
            CrossUnionProto.UnionExpRankActivityOpenMsg.Builder reqMsg = CrossUnionProto.UnionExpRankActivityOpenMsg.newBuilder();
            reqMsg.setActivityId(activityInfo.getActivityId());
            GamePlayerMgr.sendPacket(0, YanQuMessageUtils.buildMessage(Protocol.C_CROSS_UNION_EXP_RANK_OPEN_NOTIFY, reqMsg));
        }
    }

    private static ActivityInfo getUnionExpRiseRankActivity() {
        List<ActivityInfo> tempList = NormalActivityMgr.getUnionRiseRankActivityList();
        List<ActivityInfo> activityInfoList = new ArrayList<>();
        for (ActivityInfo activityInfo : tempList) {
            if ((activityInfo.getType() == eActivityType.UnionRankActivity.getValue() && activityInfo.getChildType() == 2) ||
                    (activityInfo.getType() == eActivityType.CrossUnionActivity.getValue() && activityInfo.getChildType() == 3)) {
                activityInfoList.add(activityInfo);
            }
        }
        if (activityInfoList.size() == 0) {
            return null;
        }
        if (activityInfoList.size() > 1) {
            logger.error("one more union rank activity exist.");
        }
        ActivityInfo activityInfo = activityInfoList.get(0);
        return activityInfo;
    }

    /**
    * 描述：获取开启的活动信息
    * 作者：zrq
    * 时间：2022/8/15
    * 参数：
    活动编号
    * 返回值：活动信息
    **/
    public static ActivityInfo getOpenActivityInfo(int activityId){
        ActivityInfo activityInfo = NormalActivityMgr.getActivityInfo(activityId);
        if(null == activityInfo){
            activityInfo = RelationActivityMgr.getOpenActivityInfo(activityId);
        }
        if(null == activityInfo) {
            activityInfo = UnionWarActivityMgr.getOpenActivityInfo(activityId);
        }

        if(null == activityInfo) {
            activityInfo = StrongholdActivityMgr.getOpenActivityInfo(activityId);
        }
        if (null == activityInfo){
            activityInfo = TradeWarActivityMgr.getOpenActivityInfo(activityId);
        }
        if (null == activityInfo) {
            activityInfo = OreWarActivityMgr.getOpenActivityInfo(activityId);
        }

        return activityInfo;
    }

    /**
    * 描述：获取actType
    * 作者：zrq
    * 时间：2022/8/17
    * 参数：

    * 返回值：
    **/
    public static String getActType(MallInfo mallInfo, ActivityInfo activityInfo){
        String actType = mallInfo.getActivityType();
        if(null != activityInfo){
            if(activityInfo.getType() == eActivityType.RechargeActivity.getValue() ||
                    activityInfo.getType() == eActivityType.NewRechargeActivity.getValue()
            ){
                FindActivityResult findResult = GamePublicFunction.findActivityMall(mallInfo.getMallId());
                if(findResult.isFind()){
                    actType = findResult.getActivityConditionInfo().getActtype();
                }
            }
        }
        return actType;
    }

    public static String dealWithMailDecorationReward(int activityType, long userId, String reward, eLogMoneyType master, eLogMoneyType son){
//        if(activityType != eActivityType.ChannelRankActivity.getValue() &&
//                activityType != eActivityType.RankActivity.getValue() &&
//                activityType != eActivityType.CrossRankActivity.getValue() &&
//                activityType != eActivityType.CrossUnionActivity.getValue()){
//            return reward;
//        }
        //所有活动
        Property oldReward = PropertyHelper.parseStringToProperty(reward);
        Map<Integer, Long> idNumMap = new HashMap<>();
        for (Map.Entry<Integer, BigInteger> entry : oldReward.getGoods().entrySet()) {
            if(GoodsMgr.isDecorationGoods(entry.getKey())){
                idNumMap.put(entry.getKey(), entry.getValue().longValue());
            }
        }
        if(idNumMap.size() == 0){
            return reward;
        }

        GamePlayer player = GamePlayerMgr.getOnlinePlayer(userId);
        for (Map.Entry<Integer, Long> entry : idNumMap.entrySet()) {
            int decorationId = entry.getKey();
            if(player != null){
                player.getModule(DecorationModule.class).addDecoration(decorationId, entry.getValue(), master, son);
            }else {
                UserDecoration userDecoration = UserDecorationBussiness.getUserDecorationById(userId, decorationId);
                if(userDecoration == null){
                    userDecoration = new UserDecoration();
                    userDecoration.setUserId(userId);
                    userDecoration.setDecorationId(decorationId);
                    userDecoration.setInsertOption();
                }
                long oldTime = userDecoration.getEndTime();
                GoodsInfo goodsInfo = GoodsMgr.getGoodsById(decorationId);
                long param = goodsInfo.getParamList().get(0).longValue();
                long nowTime = System.currentTimeMillis() / 1000;
                userDecoration.setModifyTime(nowTime);
                // 设置时间
                long addTime = 0;
                if (-1 != param) {
                    addTime = param * DateHelper.MINUTE_SECONDS * entry.getValue();
                    userDecoration.setEndTime(nowTime + addTime);
                }
                if(userDecoration.isInsertOption()){
                    UserDecorationBussiness.addUserDecoration(userDecoration);
                }else {
                    UserDecorationBussiness.updateUserDecoration(userDecoration);
                }

                // 财神成就
                int mammonType = MammonMgr.getMammonType(goodsInfo.getGoodsId());
                if (mammonType > 0) {
                    MammonMgr.addMammonCountCondition(userId, mammonType, entry.getValue().intValue());
                }
                MammonMgr.addUserDecoration(userDecoration);       //添加到检测管理
                AutoLogMgr.add(new LogDecoration(userId, decorationId, oldTime, userDecoration.getEndTime(), addTime, master.getValue(), son.getValue()));
            }
            oldReward.removeProperty(decorationId);
        }

        return PropertyHelper.parsePropertyToString(oldReward);
    }

    public static Map<String, ActivityConfig> getActivityConfigMap(int activityId) {
        return allActivityConfigMap.getOrDefault(activityId, new HashMap<>());
    }

    /**
     * 找到所有有配基金进度道具的活动
     */
    public static void refreshCommonFundActivityIdFromConfig() {
        Map<Integer, Set<Integer>> tempMap = new ConcurrentHashMap<>();
        List<ActivityInfo> allActivityInfos = ActivityMgr.getAllActivityInfos();
        if (allActivityInfos != null) {
            for (ActivityInfo activityInfo : allActivityInfos) {
                if (ActivityMgr.activityInShowTime(activityInfo)) {
                    //在活动期间
                    int itemId = ActivityMgr.getCommonActivityFundProgressItemId(activityInfo.getActivityId());
                    if (itemId != 0) {
                        Set<Integer> list = tempMap.get(itemId);
                        if (list == null) {
                            list = new HashSet<>();
                            tempMap.put(itemId, list);
                        }
                        list.add(activityInfo.getActivityId());
                    }
                }
            }
        }
        allActivityFundActivityIdsMap = tempMap;
    }

    public static List<Integer> getAllActivityFundActivityIds(int goodsId) {
        return new ArrayList<>(allActivityFundActivityIdsMap.getOrDefault(goodsId, new HashSet<>()));
    }

    public static IActivityMallLimitHandler getIActivityMallLimitHandler(int activityType){
        return extendLimitHandlerMap.get(activityType);
    }

    public static Map<Integer, IActivityMallLimitHandler> getExtendLimitHandlerMap() {
        return extendLimitHandlerMap;
    }
}
